From: ebotcazou Date: Sat, 11 Jul 2009 19:33:14 +0000 (+0000) Subject: * gcc-interface/ada-tree.h: Minor reorganization. X-Git-Tag: upstream/4.9.2~34921 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=91c756e66b7d9978a4b416fe607669dbe15dd313;p=platform%2Fupstream%2Flinaro-gcc.git * gcc-interface/ada-tree.h: Minor reorganization. * gcc-interface/misc.c (gnat_print_decl): Minor tweaks. (gnat_print_type): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@149518 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 187fa57..6abe933 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,9 @@ +2009-07-11 Eric Botcazou + + * gcc-interface/ada-tree.h: Minor reorganization. + * gcc-interface/misc.c (gnat_print_decl): Minor tweaks. + (gnat_print_type): Likewise. + 2009-07-11 Thomas Quinot * sem_util.adb, sem_res.adb, sem_warn.adb: Minor comment editing: diff --git a/gcc/ada/gcc-interface/ada-tree.h b/gcc/ada/gcc-interface/ada-tree.h index 8d15722..8983139 100644 --- a/gcc/ada/gcc-interface/ada-tree.h +++ b/gcc/ada/gcc-interface/ada-tree.h @@ -165,13 +165,14 @@ do { \ /* True if TYPE can alias any other types. */ #define TYPE_UNIVERSAL_ALIASING_P(NODE) TYPE_LANG_FLAG_6 (NODE) -/* This field is only defined for FUNCTION_TYPE nodes. If the Ada subprogram - contains no parameters passed by copy in/copy out then this field is zero. - Otherwise it points to a list of nodes used to specify the return values - of the out (or in out) parameters that qualify to be passed by copy in/ - copy out. For a full description of the copy in/copy out parameter passing - mechanism refer to the routine gnat_to_gnu_entity. */ -#define TYPE_CI_CO_LIST(NODE) TYPE_LANG_SLOT_1 (FUNCTION_TYPE_CHECK (NODE)) +/* In an UNCONSTRAINED_ARRAY_TYPE, this is the record containing both the + template and the object. + + ??? We also put this on an ENUMERAL_TYPE that is dummy. Technically, + this is a conflict on the minval field, but there doesn't seem to be + simple fix, so we'll live with this kludge for now. */ +#define TYPE_OBJECT_RECORD_TYPE(NODE) \ + (TREE_CHECK2 ((NODE), UNCONSTRAINED_ARRAY_TYPE, ENUMERAL_TYPE)->type.minval) /* For numerical types, this is the GCC lower bound of the type. The GCC type system is based on the invariant that an object X of a given type @@ -187,6 +188,13 @@ do { \ considers that the assertion X <= UB is always true. */ #define TYPE_GCC_MAX_VALUE(NODE) (NUMERICAL_TYPE_CHECK (NODE)->type.maxval) +/* For a FUNCTION_TYPE, if the subprogram has parameters passed by copy in/ + copy out, this is the list of nodes used to specify the return values of + the out (or in out) parameters that are passed by copy in/copy out. For + a full description of the copy in/copy out parameter passing mechanism + refer to the routine gnat_to_gnu_entity. */ +#define TYPE_CI_CO_LIST(NODE) TYPE_LANG_SLOT_1 (FUNCTION_TYPE_CHECK (NODE)) + /* For numerical types, this holds various RM-defined values. */ #define TYPE_RM_VALUES(NODE) TYPE_LANG_SLOT_1 (NUMERICAL_TYPE_CHECK (NODE)) @@ -256,15 +264,6 @@ do { \ (TYPE_RM_MAX_VALUE (NODE) \ ? TYPE_RM_MAX_VALUE (NODE) : TYPE_GCC_MAX_VALUE (NODE)) -/* In an UNCONSTRAINED_ARRAY_TYPE, points to the record containing both - the template and object. - - ??? We also put this on an ENUMERAL_TYPE that's dummy. Technically, - this is a conflict on the minval field, but there doesn't seem to be - simple fix, so we'll live with this kludge for now. */ -#define TYPE_OBJECT_RECORD_TYPE(NODE) \ - (TREE_CHECK2 ((NODE), UNCONSTRAINED_ARRAY_TYPE, ENUMERAL_TYPE)->type.minval) - /* For an INTEGER_TYPE with TYPE_MODULAR_P, this is the value of the modulus. */ #define TYPE_MODULUS(NODE) GET_TYPE_LANG_SPECIFIC (INTEGER_TYPE_CHECK (NODE)) @@ -293,7 +292,7 @@ do { \ #define SET_TYPE_ACTUAL_BOUNDS(NODE, X) \ SET_TYPE_LANG_SPECIFIC (TREE_CHECK2 (NODE, INTEGER_TYPE, ARRAY_TYPE), X) -/* For a RECORD_TYPE that is a fat pointer, point to the type for the +/* For a RECORD_TYPE that is a fat pointer, this is the type for the unconstrained object. Likewise for a RECORD_TYPE that is pointed to by a thin pointer. */ #define TYPE_UNCONSTRAINED_ARRAY(NODE) \ @@ -301,9 +300,9 @@ do { \ #define SET_TYPE_UNCONSTRAINED_ARRAY(NODE, X) \ SET_TYPE_LANG_SPECIFIC (RECORD_TYPE_CHECK (NODE), X) -/* For other RECORD_TYPEs and all UNION_TYPEs and QUAL_UNION_TYPEs, the Ada - size of the object. This differs from the GCC size in that it does not - include any rounding up to the alignment of the type. */ +/* For other RECORD_TYPEs and all UNION_TYPEs and QUAL_UNION_TYPEs, this is + the Ada size of the object. This differs from the GCC size in that it + does not include any rounding up to the alignment of the type. */ #define TYPE_ADA_SIZE(NODE) \ GET_TYPE_LANG_SPECIFIC (RECORD_OR_UNION_CHECK (NODE)) #define SET_TYPE_ADA_SIZE(NODE, X) \ diff --git a/gcc/ada/gcc-interface/misc.c b/gcc/ada/gcc-interface/misc.c index fb30620..587eab3 100644 --- a/gcc/ada/gcc-interface/misc.c +++ b/gcc/ada/gcc-interface/misc.c @@ -470,17 +470,17 @@ gnat_print_decl (FILE *file, tree node, int indent) switch (TREE_CODE (node)) { case CONST_DECL: - print_node (file, "const_corresponding_var", + print_node (file, "corresponding var", DECL_CONST_CORRESPONDING_VAR (node), indent + 4); break; case FIELD_DECL: - print_node (file, "original_field", DECL_ORIGINAL_FIELD (node), + print_node (file, "original field", DECL_ORIGINAL_FIELD (node), indent + 4); break; case VAR_DECL: - print_node (file, "renamed_object", DECL_RENAMED_OBJECT (node), + print_node (file, "renamed object", DECL_RENAMED_OBJECT (node), indent + 4); break; @@ -497,7 +497,7 @@ gnat_print_type (FILE *file, tree node, int indent) switch (TREE_CODE (node)) { case FUNCTION_TYPE: - print_node (file, "ci_co_list", TYPE_CI_CO_LIST (node), indent + 4); + print_node (file, "ci/co list", TYPE_CI_CO_LIST (node), indent + 4); break; case INTEGER_TYPE: