]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[Ada] Use encoded names only with -fgnat-encodings=all
authorEric Botcazou <ebotcazou@adacore.com>
Fri, 4 Jun 2021 16:08:49 +0000 (18:08 +0200)
committerPierre-Marie de Rodat <derodat@adacore.com>
Thu, 8 Jul 2021 13:34:23 +0000 (13:34 +0000)
gcc/ada/

* exp_dbug.adb (Get_Encoded_Name): Do not encode names of discrete
types with custom bounds, except with -fgnat-encodings=all.
* exp_pakd.adb (Create_Packed_Array_Impl_Type): Adjust comment.

gcc/ada/exp_dbug.adb
gcc/ada/exp_pakd.adb

index ed5ae43be9bd5eb786e49f9ac1b980fce6e7d05d..bfc3b3356f11c3fc11b3877345d8ea36f4c22848 100644 (file)
@@ -655,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));
@@ -668,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
index 7e295024b9d4417d29e23e4e5deb28139a0c777a..3477bba3d78b84c9af4c8c3566e8ef737c9ea035 100644 (file)
@@ -828,8 +828,8 @@ package body Exp_Pakd is
 
       elsif not Is_Constrained (Typ) then
 
-         --  When generating standard DWARF (i.e when GNAT_Encodings is
-         --  DWARF_GNAT_Encodings_Minimal), the ___XP suffix will be stripped
+         --  When generating standard DWARF (i.e when GNAT_Encodings is not
+         --  DWARF_GNAT_Encodings_All), the ___XP suffix will be stripped
          --  by the back-end but generate it anyway to ease compiler debugging.
          --  This will help to distinguish implementation types from original
          --  packed arrays.