aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/gcc-interface/ada-tree.h
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2019-01-27 19:14:14 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2019-01-27 19:14:14 +0000
commit683ccd0568569c67b117e87638782c6d870791b2 (patch)
treed3ad36179e7f2d6037dde651ff566d81ef28ab8a /gcc/ada/gcc-interface/ada-tree.h
parent33731c666114349344848ddd4218f98ef486398e (diff)
downloadgcc-683ccd0568569c67b117e87638782c6d870791b2.zip
gcc-683ccd0568569c67b117e87638782c6d870791b2.tar.gz
gcc-683ccd0568569c67b117e87638782c6d870791b2.tar.bz2
repinfo.adb (List_Component_Layout): Remove superfluous space for zero-sized field.
* repinfo.adb (List_Component_Layout): Remove superfluous space for zero-sized field. * gcc-interface/ada-tree.h (TYPE_IS_EXTRA_SUBTYPE_P): New macro. * gcc-interface/gigi.h (create_extra_subtype): Declare. * gcc-interface/decl.c (TYPE_ARRAY_SIZE_LIMIT): Likewise. (update_n_elem): New function. (gnat_to_gnu_entity): Use create_extra_subtype to create extra subtypes instead of doing it manually. <E_Array_Type>: Use update_n_elem to compute the maximum size. Use the index type instead of base type for the bounds. Set TYPE_ARRAY_MAX_SIZE of the array to the maximum size. <E_Array_Subtype>: Create an extra subtype using the index type of the base array type for self-referential bounds. Use update_n_elem to compute the maximum size. Set TYPE_ARRAY_MAX_SIZE of the array to the maximum size. (gnat_to_gnu_field): Clear DECL_NONADDRESSABLE_P on discriminants. * gcc-interface/misc.c (gnat_get_alias_set): Return the alias set of the base type for an extra subtype. (gnat_type_max_size): Remove obsolete code. * gcc-interface/trans.c (Attribute_to_gnu): Minor tweak. (can_be_lower_p): Deal with pathological types. * gcc-interface/utils.c (create_extra_subtype): New function. (create_field_decl): Minor tweak. (max_size) <tcc_reference>: Compute a better value by using the extra subtypes on the self-referential bounds. <tcc_binary>: Rewrite. Deal with "negative value" in unsigned types. <tcc_expression>: Likewise. * gcc-interface/utils2.c (compare_arrays): Retrieve the original bounds of the arrays upfront. Swap only if the second length is not constant. Use comparisons on the original bounds consistently for the null tests. (build_binary_op): Use TYPE_IS_EXTRA_SUBTYPE_P macro. (build_allocator): Minor tweak. From-SVN: r268318
Diffstat (limited to 'gcc/ada/gcc-interface/ada-tree.h')
-rw-r--r--gcc/ada/gcc-interface/ada-tree.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/gcc/ada/gcc-interface/ada-tree.h b/gcc/ada/gcc-interface/ada-tree.h
index 77e6bac..ea2c945 100644
--- a/gcc/ada/gcc-interface/ada-tree.h
+++ b/gcc/ada/gcc-interface/ada-tree.h
@@ -111,6 +111,9 @@ do { \
front-end. */
#define TYPE_EXTRA_SUBTYPE_P(NODE) TYPE_LANG_FLAG_2 (INTEGER_TYPE_CHECK (NODE))
+#define TYPE_IS_EXTRA_SUBTYPE_P(NODE) \
+ (TREE_CODE (NODE) == INTEGER_TYPE && TYPE_EXTRA_SUBTYPE_P (NODE))
+
/* Nonzero for an aggregate type if this is a by-reference type. We also
set this on an ENUMERAL_TYPE that is dummy. */
#define TYPE_BY_REFERENCE_P(NODE) \