aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/gcc-interface/utils.c
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2011-04-02 09:20:38 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2011-04-02 09:20:38 +0000
commitde9528f0291faf10d65dd7b00f7101005c2ee38a (patch)
treefe3e25770758003527c12bdff72d889d7d5ccae0 /gcc/ada/gcc-interface/utils.c
parentd9d7a26cf1ad153c2185a8d0d01f11ef60ce321b (diff)
downloadgcc-de9528f0291faf10d65dd7b00f7101005c2ee38a.zip
gcc-de9528f0291faf10d65dd7b00f7101005c2ee38a.tar.gz
gcc-de9528f0291faf10d65dd7b00f7101005c2ee38a.tar.bz2
utils.c (update_pointer_to): Finalize named pointer types.
* gcc-interface/utils.c (update_pointer_to): Finalize named pointer types. From-SVN: r171887
Diffstat (limited to 'gcc/ada/gcc-interface/utils.c')
-rw-r--r--gcc/ada/gcc-interface/utils.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/gcc/ada/gcc-interface/utils.c b/gcc/ada/gcc-interface/utils.c
index bd6badd..dc74374 100644
--- a/gcc/ada/gcc-interface/utils.c
+++ b/gcc/ada/gcc-interface/utils.c
@@ -3559,7 +3559,12 @@ update_pointer_to (tree old_type, tree new_type)
for (; ptr; ptr = TYPE_NEXT_PTR_TO (ptr))
for (t = TYPE_MAIN_VARIANT (ptr); t; t = TYPE_NEXT_VARIANT (t))
TREE_TYPE (t) = new_type;
- TYPE_POINTER_TO (old_type) = NULL_TREE;
+
+ /* If we have adjusted named types, finalize them. This is necessary
+ since we had forced a DWARF typedef for them in gnat_pushdecl. */
+ for (ptr = TYPE_POINTER_TO (old_type); ptr; ptr = TYPE_NEXT_PTR_TO (ptr))
+ if (TYPE_NAME (ptr) && TREE_CODE (TYPE_NAME (ptr)) == TYPE_DECL)
+ rest_of_type_decl_compilation (TYPE_NAME (ptr));
/* Chain REF and its variants at the end. */
new_ref = TYPE_REFERENCE_TO (new_type);
@@ -3576,6 +3581,8 @@ update_pointer_to (tree old_type, tree new_type)
for (; ref; ref = TYPE_NEXT_REF_TO (ref))
for (t = TYPE_MAIN_VARIANT (ref); t; t = TYPE_NEXT_VARIANT (t))
TREE_TYPE (t) = new_type;
+
+ TYPE_POINTER_TO (old_type) = NULL_TREE;
TYPE_REFERENCE_TO (old_type) = NULL_TREE;
}