diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2009-09-14 19:27:21 +0000 |
---|---|---|
committer | Eric Botcazou <ebotcazou@gcc.gnu.org> | 2009-09-14 19:27:21 +0000 |
commit | 40c88b9403ef1e2b2e93ff70a5fb794916027665 (patch) | |
tree | 60a554690ff540bb38e350af14ceebfd44fee09f /gcc/ada/gcc-interface/utils.c | |
parent | 1d65f45cfaefa060737af130c3fc69afb3030980 (diff) | |
download | gcc-40c88b9403ef1e2b2e93ff70a5fb794916027665.zip gcc-40c88b9403ef1e2b2e93ff70a5fb794916027665.tar.gz gcc-40c88b9403ef1e2b2e93ff70a5fb794916027665.tar.bz2 |
exp_dbug.ads (Packed Array Encoding): Document the new encoding for the unconstrained case.
* exp_dbug.ads (Packed Array Encoding): Document the new encoding for
the unconstrained case.
* gcc-interfaces/decl.c (gnat_to_gnu_entity) <E_Array_Type>: Implement
the encoding. Do not give a name to the pointer type to the XUT type.
* gcc-interfaces/utils.c (gnat_pushdecl): Propagate DECL_ORIGINAL_TYPE
for fat pointer types, if any. Make sure DECL_ARTIFICIAL is cleared
on nodes with DECL_ORIGINAL_TYPE set.
(update_pointer_to): Set DECL_ORIGINAL_TYPE to the original pointer
for fat pointer types. Make sure DECL_ARTIFICIAL is cleared.
From-SVN: r151697
Diffstat (limited to 'gcc/ada/gcc-interface/utils.c')
-rw-r--r-- | gcc/ada/gcc-interface/utils.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/gcc/ada/gcc-interface/utils.c b/gcc/ada/gcc-interface/utils.c index bd6a840..31f24ce 100644 --- a/gcc/ada/gcc-interface/utils.c +++ b/gcc/ada/gcc-interface/utils.c @@ -495,8 +495,12 @@ gnat_pushdecl (tree decl, Node_Id gnat_node) TYPE_NAME (tt) = decl; TREE_USED (tt) = TREE_USED (t); TREE_TYPE (decl) = tt; - DECL_ORIGINAL_TYPE (decl) = t; + if (DECL_ORIGINAL_TYPE (TYPE_NAME (t))) + DECL_ORIGINAL_TYPE (decl) = DECL_ORIGINAL_TYPE (TYPE_NAME (t)); + else + DECL_ORIGINAL_TYPE (decl) = t; t = NULL_TREE; + DECL_ARTIFICIAL (decl) = 0; } else if (DECL_ARTIFICIAL (TYPE_NAME (t)) && !DECL_ARTIFICIAL (decl)) ; @@ -3665,6 +3669,18 @@ update_pointer_to (tree old_type, tree new_type) TYPE_POINTER_TO (new_type) = TYPE_REFERENCE_TO (new_type) = TREE_TYPE (new_type) = ptr; + /* And show the original pointer NEW_PTR to the debugger. This is the + counterpart of the equivalent processing in gnat_pushdecl when the + unconstrained array type is frozen after access types to it. Note + that update_pointer_to can be invoked multiple times on the same + couple of types because of the type variants. */ + if (TYPE_NAME (ptr) + && TREE_CODE (TYPE_NAME (ptr)) == TYPE_DECL + && !DECL_ORIGINAL_TYPE (TYPE_NAME (ptr))) + { + DECL_ORIGINAL_TYPE (TYPE_NAME (ptr)) = new_ptr; + DECL_ARTIFICIAL (TYPE_NAME (ptr)) = 0; + } for (var = TYPE_MAIN_VARIANT (ptr); var; var = TYPE_NEXT_VARIANT (var)) SET_TYPE_UNCONSTRAINED_ARRAY (var, new_type); |