diff options
author | Pierre-Marie de Rodat <derodat@adacore.com> | 2016-10-11 10:35:43 +0000 |
---|---|---|
committer | Eric Botcazou <ebotcazou@gcc.gnu.org> | 2016-10-11 10:35:43 +0000 |
commit | 656b031126ee1679e97b03484cd870d68dd387a9 (patch) | |
tree | 8ee7e92fd6e2a32018317f96b606021e045aed70 /gcc/ada/gcc-interface/trans.c | |
parent | 4bb4acee6878e291e3972feb6dcd154bce915190 (diff) | |
download | gcc-656b031126ee1679e97b03484cd870d68dd387a9.zip gcc-656b031126ee1679e97b03484cd870d68dd387a9.tar.gz gcc-656b031126ee1679e97b03484cd870d68dd387a9.tar.bz2 |
exp_dbug.adb (Debug_Renaming_Declaration): Process underlying types.
* exp_dbug.adb (Debug_Renaming_Declaration): Process underlying types.
Emit GNAT encodings for object renamings involving record components
whose normalized bit offset is not null.
* uintp.h (UI_No_Uint): Declare.
* gcc-interface/gigi.h (can_materialize_object_renaming_p): New.
* gcc-interface/utils.c (can_materialize_object_renaming_p): New
function.
* gcc-interface/trans.c (gnat_to_gnu) <N_Object_Renaming_Declaration>:
In code generation mode, materialize all renamings as long as they need
debug info and we are not optimizing.
From-SVN: r240985
Diffstat (limited to 'gcc/ada/gcc-interface/trans.c')
-rw-r--r-- | gcc/ada/gcc-interface/trans.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/gcc/ada/gcc-interface/trans.c b/gcc/ada/gcc-interface/trans.c index 930725b..7b319d4 100644 --- a/gcc/ada/gcc-interface/trans.c +++ b/gcc/ada/gcc-interface/trans.c @@ -6084,10 +6084,18 @@ gnat_to_gnu (Node_Id gnat_node) gnat_temp = Defining_Entity (gnat_node); gnu_result = alloc_stmt_list (); - /* Don't do anything if this renaming is handled by the front end or if - we are just annotating types and this object has a composite or task - type, don't elaborate it. */ - if (!Is_Renaming_Of_Object (gnat_temp) + /* Don't do anything if this renaming is handled by the front end and it + does not need debug info. Note that we consider renamings don't need + debug info when optimizing: our way to describe them has a + memory/elaboration footprint. + + Don't do anything neither if we are just annotating types and this + object has a composite or task type, don't elaborate it. */ + if ((!Is_Renaming_Of_Object (gnat_temp) + || (Needs_Debug_Info (gnat_temp) + && !optimize + && can_materialize_object_renaming_p + (Renamed_Object (gnat_temp)))) && ! (type_annotate_only && (Is_Array_Type (Etype (gnat_temp)) || Is_Record_Type (Etype (gnat_temp)) |