diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2011-04-02 08:59:45 +0000 |
---|---|---|
committer | Eric Botcazou <ebotcazou@gcc.gnu.org> | 2011-04-02 08:59:45 +0000 |
commit | 4cb12a90e73ccb9ce365e8462ea68e6163493746 (patch) | |
tree | d5038c6b13bc19996e82bcbc51df525f54af3324 /gcc | |
parent | acccc61c771bfc3f78a49805a3382626314da520 (diff) | |
download | gcc-4cb12a90e73ccb9ce365e8462ea68e6163493746.zip gcc-4cb12a90e73ccb9ce365e8462ea68e6163493746.tar.gz gcc-4cb12a90e73ccb9ce365e8462ea68e6163493746.tar.bz2 |
utils.c (gnat_pushdecl): If this is a non-artificial declaration of a pointer type...
* gcc-interface/utils.c (gnat_pushdecl): If this is a non-artificial
declaration of a pointer type, then set DECL_ORIGINAL_TYPE to a
distinct copy.
From-SVN: r171885
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ada/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/ada/gcc-interface/utils.c | 8 |
2 files changed, 12 insertions, 2 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index ef21acc..766d2bc 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,5 +1,11 @@ 2011-04-02 Eric Botcazou <ebotcazou@adacore.com> + * gcc-interface/utils.c (gnat_pushdecl): If this is a non-artificial + declaration of a pointer type, then set DECL_ORIGINAL_TYPE to a + distinct copy. + +2011-04-02 Eric Botcazou <ebotcazou@adacore.com> + * gcc-interface/decl.c (gnat_to_gnu_entity): Do not force the DECL_ARTIFICIAL flag on enumeration types. diff --git a/gcc/ada/gcc-interface/utils.c b/gcc/ada/gcc-interface/utils.c index 6472a0c..bd6badd 100644 --- a/gcc/ada/gcc-interface/utils.c +++ b/gcc/ada/gcc-interface/utils.c @@ -560,12 +560,16 @@ gnat_pushdecl (tree decl, Node_Id gnat_node) if (!(TYPE_NAME (t) && TREE_CODE (TYPE_NAME (t)) == TYPE_DECL)) { - /* Array types aren't tagged types in the C sense so we force the + /* Array and pointer types aren't "tagged" types so we force the type to be associated with its typedef in the DWARF back-end, in order to make sure that the latter is always preserved. */ - if (!DECL_ARTIFICIAL (decl) && TREE_CODE (t) == ARRAY_TYPE) + if (!DECL_ARTIFICIAL (decl) + && (TREE_CODE (t) == ARRAY_TYPE + || TREE_CODE (t) == POINTER_TYPE)) { tree tt = build_distinct_type_copy (t); + if (TREE_CODE (t) == POINTER_TYPE) + TYPE_NEXT_PTR_TO (t) = tt; TYPE_NAME (tt) = DECL_NAME (decl); TYPE_STUB_DECL (tt) = TYPE_STUB_DECL (t); DECL_ORIGINAL_TYPE (decl) = tt; |