aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/utils.c
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@gcc.gnu.org>2008-04-06 10:22:23 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2008-04-06 10:22:23 +0000
commit1bde5bc4681ac3713d54d6511cfb6000be57114f (patch)
tree42de824735fa6830fb3e6d3b17e3783804163d36 /gcc/ada/utils.c
parentd7d7db8b40e645ae15a530348b55d2b11a7d3135 (diff)
downloadgcc-1bde5bc4681ac3713d54d6511cfb6000be57114f.zip
gcc-1bde5bc4681ac3713d54d6511cfb6000be57114f.tar.gz
gcc-1bde5bc4681ac3713d54d6511cfb6000be57114f.tar.bz2
decl.c (rest_of_type_decl_compilation_no_defer): New local function used to process all the variants of the specified type.
* decl.c (rest_of_type_decl_compilation_no_defer): New local function used to process all the variants of the specified type. (gnat_to_gnu_entity): Invoke rest_of_type_decl_compilation for enumeral types too. Call rest_of_type_decl_compilation_no_defer if undeferring. (rest_of_type_decl_compilation): Likewise. * utils.c (gnat_pushdecl): Propagate the name to all variants of type. From-SVN: r133957
Diffstat (limited to 'gcc/ada/utils.c')
-rw-r--r--gcc/ada/utils.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/gcc/ada/utils.c b/gcc/ada/utils.c
index 2cde34e..d138976 100644
--- a/gcc/ada/utils.c
+++ b/gcc/ada/utils.c
@@ -447,7 +447,7 @@ gnat_pushdecl (tree decl, Node_Id gnat_node)
tree t = TREE_TYPE (decl);
if (!TYPE_NAME (t) || TREE_CODE (TYPE_NAME (t)) == IDENTIFIER_NODE)
- TYPE_NAME (t) = decl;
+ ;
else if (TYPE_FAT_POINTER_P (t))
{
tree tt = build_variant_type_copy (t);
@@ -455,9 +455,18 @@ gnat_pushdecl (tree decl, Node_Id gnat_node)
TREE_USED (tt) = TREE_USED (t);
TREE_TYPE (decl) = tt;
DECL_ORIGINAL_TYPE (decl) = t;
+ t = NULL_TREE;
}
else if (DECL_ARTIFICIAL (TYPE_NAME (t)) && !DECL_ARTIFICIAL (decl))
- TYPE_NAME (t) = decl;
+ ;
+ else
+ t = NULL_TREE;
+
+ /* Propagate the name to all the variants. This is needed for
+ the type qualifiers machinery to work properly. */
+ if (t)
+ for (t = TYPE_MAIN_VARIANT (t); t; t = TYPE_NEXT_VARIANT (t))
+ TYPE_NAME (t) = decl;
}
}