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/exp_dbug.adb | |
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/exp_dbug.adb')
-rw-r--r-- | gcc/ada/exp_dbug.adb | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/gcc/ada/exp_dbug.adb b/gcc/ada/exp_dbug.adb index df0543d..7145450 100644 --- a/gcc/ada/exp_dbug.adb +++ b/gcc/ada/exp_dbug.adb @@ -333,7 +333,7 @@ package body Exp_Dbug is ---------------------------- procedure Enable_If_Packed_Array (N : Node_Id) is - T : constant Entity_Id := Etype (N); + T : constant Entity_Id := Underlying_Type (Etype (N)); begin Enable := Enable or else (Ekind (T) in Array_Kind @@ -390,7 +390,16 @@ package body Exp_Dbug is exit; when N_Selected_Component => - Enable := Enable or else Is_Packed (Etype (Prefix (Ren))); + declare + First_Bit : constant Uint := + Normalized_First_Bit (Entity (Selector_Name (Ren))); + begin + Enable := + (Enable + or else Is_Packed (Underlying_Type (Etype (Prefix (Ren)))) + or else (First_Bit /= No_Uint + and then First_Bit /= Uint_0)); + end; Prepend_String_To_Buffer (Get_Name_String (Chars (Selector_Name (Ren)))); Prepend_String_To_Buffer ("XR"); |