diff options
author | Ian Lance Taylor <iant@golang.org> | 2021-09-13 10:37:49 -0700 |
---|---|---|
committer | Ian Lance Taylor <iant@golang.org> | 2021-09-13 10:37:49 -0700 |
commit | e252b51ccde010cbd2a146485d8045103cd99533 (patch) | |
tree | e060f101cdc32bf5e520de8e5275db9d4236b74c /gcc/ada/exp_dbug.adb | |
parent | f10c7c4596dda99d2ee872c995ae4aeda65adbdf (diff) | |
parent | 104c05c5284b7822d770ee51a7d91946c7e56d50 (diff) | |
download | gcc-e252b51ccde010cbd2a146485d8045103cd99533.zip gcc-e252b51ccde010cbd2a146485d8045103cd99533.tar.gz gcc-e252b51ccde010cbd2a146485d8045103cd99533.tar.bz2 |
Merge from trunk revision 104c05c5284b7822d770ee51a7d91946c7e56d50.
Diffstat (limited to 'gcc/ada/exp_dbug.adb')
-rw-r--r-- | gcc/ada/exp_dbug.adb | 71 |
1 files changed, 40 insertions, 31 deletions
diff --git a/gcc/ada/exp_dbug.adb b/gcc/ada/exp_dbug.adb index bb0003d..bfc3b33 100644 --- a/gcc/ada/exp_dbug.adb +++ b/gcc/ada/exp_dbug.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1996-2020, Free Software Foundation, Inc. -- +-- Copyright (C) 1996-2021, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -24,23 +24,27 @@ ------------------------------------------------------------------------------ with Alloc; -with Atree; use Atree; -with Debug; use Debug; -with Einfo; use Einfo; -with Exp_Util; use Exp_Util; -with Nlists; use Nlists; -with Nmake; use Nmake; -with Opt; use Opt; -with Output; use Output; -with Sem_Aux; use Sem_Aux; -with Sem_Eval; use Sem_Eval; -with Sem_Util; use Sem_Util; -with Sinfo; use Sinfo; -with Stand; use Stand; -with Stringt; use Stringt; +with Atree; use Atree; +with Debug; use Debug; +with Einfo; use Einfo; +with Einfo.Entities; use Einfo.Entities; +with Einfo.Utils; use Einfo.Utils; +with Exp_Util; use Exp_Util; +with Nlists; use Nlists; +with Nmake; use Nmake; +with Opt; use Opt; +with Output; use Output; +with Sem_Aux; use Sem_Aux; +with Sem_Eval; use Sem_Eval; +with Sem_Util; use Sem_Util; +with Sinfo; use Sinfo; +with Sinfo.Nodes; use Sinfo.Nodes; +with Sinfo.Utils; use Sinfo.Utils; +with Stand; use Stand; +with Stringt; use Stringt; with Table; -with Tbuild; use Tbuild; -with Urealp; use Urealp; +with Tbuild; use Tbuild; +with Urealp; use Urealp; package body Exp_Dbug is @@ -315,8 +319,11 @@ package body Exp_Dbug is -- output in one of these two forms. The result is prepended to the -- name stored in Name_Buffer. - function Scope_Contains (Sc : Node_Id; Ent : Entity_Id) return Boolean; - -- Return whether Ent belong to the Sc scope + function Scope_Contains + (Outer : Entity_Id; + Inner : Entity_Id) + return Boolean; + -- Return whether Inner belongs to the Outer scope ---------------------------- -- Enable_If_Packed_Array -- @@ -344,8 +351,7 @@ package body Exp_Dbug is elsif Nkind (N) = N_Identifier and then Scope_Contains (Scope (Entity (N)), Ent) - and then (Ekind (Entity (N)) = E_Constant - or else Ekind (Entity (N)) = E_In_Parameter) + and then Ekind (Entity (N)) in E_Constant | E_In_Parameter then Prepend_String_To_Buffer (Get_Name_String (Chars (Entity (N)))); @@ -361,12 +367,16 @@ package body Exp_Dbug is -- Scope_Contains -- -------------------- - function Scope_Contains (Sc : Node_Id; Ent : Entity_Id) return Boolean is - Cur : Node_Id := Scope (Ent); + function Scope_Contains + (Outer : Entity_Id; + Inner : Entity_Id) + return Boolean + is + Cur : Entity_Id := Scope (Inner); begin while Present (Cur) loop - if Cur = Sc then + if Cur = Outer then return True; end if; @@ -645,10 +655,10 @@ package body Exp_Dbug is Has_Suffix := True; - -- Fixed-point case: generate GNAT encodings when asked to + -- Generate GNAT encodings when asked to for fixed-point case - if Is_Fixed_Point_Type (E) - and then GNAT_Encodings = DWARF_GNAT_Encodings_All + if GNAT_Encodings = DWARF_GNAT_Encodings_All + and then Is_Fixed_Point_Type (E) then Get_External_Name (E, True, "XF_"); Add_Real_To_Buffer (Delta_Value (E)); @@ -658,10 +668,9 @@ package body Exp_Dbug is Add_Real_To_Buffer (Small_Value (E)); end if; - -- Discrete case where bounds do not match size. Not necessary if we can - -- emit standard DWARF. + -- Likewise for discrete case where bounds do not match size - elsif GNAT_Encodings /= DWARF_GNAT_Encodings_Minimal + elsif GNAT_Encodings = DWARF_GNAT_Encodings_All and then Is_Discrete_Type (E) and then not Bounds_Match_Size (E) then @@ -1547,7 +1556,7 @@ package body Exp_Dbug is then Set_BNPE_Suffix (Ent); - -- Strip trailing n's and last trailing b as required. note that + -- Strip trailing n's and last trailing b as required. Note that -- we know there is at least one b, or no suffix would be generated. while Name_Buffer (Name_Len) = 'n' loop |