aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2018-05-29 09:29:28 +0000
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>2018-05-29 09:29:28 +0000
commit28cfa2697563a6d91c04cc47ad75a99aa074e930 (patch)
tree8fd4980eb095a485aac1e02eb0aa31fa410f99b8 /gcc
parent9f4b346b0b604183a7b2285df61961ebb4a4c582 (diff)
downloadgcc-28cfa2697563a6d91c04cc47ad75a99aa074e930.zip
gcc-28cfa2697563a6d91c04cc47ad75a99aa074e930.tar.gz
gcc-28cfa2697563a6d91c04cc47ad75a99aa074e930.tar.bz2
[Ada] Fix irregular output with -gnatRm
The information displayed by -gnatRm was using slightly different naming and formatting conventions than the rest of the -gnatR information with no justification, so this adjusts it for the sake of consistency. For the following package: package P is function F (I : Integer) return Integer; type Rec is limited record I : Integer; end record; procedure P1 (R : Rec; I : out Integer); procedure P2 (R : Rec; I : out Integer); pragma Linker_Section (P2, ".my_section"); package Inner is procedure P3; end Inner; end P; package body P is function F (I : Integer) return Integer is begin return I; end; procedure P1 (R : Rec; I : out Integer) is begin I := R.I; end; procedure P2 (R : Rec; I : out Integer) is begin I := R.I; end; package body Inner is procedure P3 is begin null; end; end Inner; end P; the output of -gnatRm must be: Representation information for unit P (body) -------------------------------------------- Representation information for unit P (spec) -------------------------------------------- function F declared at p7.ads:3:12 convention : Ada I : passed by copy returns by copy for Rec'Size use 32; for Rec'Alignment use 4; for Rec use record I at 0 range 0 .. 31; end record; procedure P1 declared at p7.ads:9:13 convention : Ada R : passed by reference I : passed by copy procedure P2 declared at p7.ads:11:13 convention : Ada R : passed by reference I : passed by copy pragma Linker_Section (P2, ".my_section"); procedure Inner.P3 declared at p7.ads:16:15 convention : Ada 2018-05-29 Eric Botcazou <ebotcazou@adacore.com> gcc/ada/ * repinfo.adb (List_Entities): Do not list the Linker_Section for subprograms here... (List_Mechanisms): ...but here instead. Use consistent name output and formatting conventions. From-SVN: r260861
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ada/ChangeLog7
-rw-r--r--gcc/ada/repinfo.adb16
2 files changed, 16 insertions, 7 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index b0bf034..809d468 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,10 @@
+2018-05-29 Eric Botcazou <ebotcazou@adacore.com>
+
+ * repinfo.adb (List_Entities): Do not list the Linker_Section for
+ subprograms here...
+ (List_Mechanisms): ...but here instead. Use consistent name output
+ and formatting conventions.
+
2018-05-29 Bob Duff <duff@adacore.com>
* lib-writ.adb (Write_ALI): Cleanup: avoid use of global var; call new
diff --git a/gcc/ada/repinfo.adb b/gcc/ada/repinfo.adb
index d19ab0f..3b79aa1 100644
--- a/gcc/ada/repinfo.adb
+++ b/gcc/ada/repinfo.adb
@@ -393,8 +393,6 @@ package body Repinfo is
or else Debug_Flag_AA
then
if Is_Subprogram (E) then
- List_Linker_Section (E);
-
if List_Representation_Info_Mechanisms then
List_Mechanisms (E);
end if;
@@ -746,13 +744,12 @@ package body Repinfo is
raise Program_Error;
end case;
- Get_Unqualified_Decoded_Name_String (Chars (Ent));
- Write_Str (Name_Buffer (1 .. Name_Len));
+ List_Name (Ent);
Write_Str (" declared at ");
Write_Location (Sloc (Ent));
Write_Eol;
- Write_Str (" convention : ");
+ Write_Str ("convention : ");
case Convention (Ent) is
when Convention_Ada =>
@@ -814,12 +811,13 @@ package body Repinfo is
Form := First_Formal (Ent);
while Present (Form) loop
Get_Unqualified_Decoded_Name_String (Chars (Form));
+ Set_Casing (Unit_Casing);
while Name_Len <= Plen loop
Name_Len := Name_Len + 1;
Name_Buffer (Name_Len) := ' ';
end loop;
- Write_Str (" ");
+ Write_Str (" ");
Write_Str (Name_Buffer (1 .. Plen + 1));
Write_Str (": passed by ");
@@ -829,10 +827,14 @@ package body Repinfo is
end loop;
if Etype (Ent) /= Standard_Void_Type then
- Write_Str (" returns by ");
+ Write_Str ("returns by ");
Write_Mechanism (Mechanism (Ent));
Write_Eol;
end if;
+
+ if not Is_Entry (Ent) then
+ List_Linker_Section (Ent);
+ end if;
end List_Mechanisms;
---------------