]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[Ada] More complete information level for -gnatR4 output
authorpmderodat <pmderodat@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 20 Aug 2019 09:49:28 +0000 (09:49 +0000)
committerpmderodat <pmderodat@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 20 Aug 2019 09:49:28 +0000 (09:49 +0000)
This instructs -gnatR4 to also list the Etype of a user-declared record
subtype if it is compiler-generated, for example in:

package P is

   type U_Arr is array (Integer range <>) of Character;

   type Rec1 (D1, D2 : Integer) is record
      C : U_Arr (D1 .. D2);
   end record;

   type Rec_N is new Rec1 (1, 2);

end P;

2019-08-20  Eric Botcazou  <ebotcazou@adacore.com>

gcc/ada/

* repinfo.adb (List_Record_Info): In -gnatR4 mode, set the
relevant flag on the implicit base type of a record subtype.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@274727 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ada/ChangeLog
gcc/ada/repinfo.adb

index e9a8e79a0dba13f2a16e9681118531b2ac97a05d..82dd6a17a25c5cc1ddb36be914de923c05bd71db 100644 (file)
@@ -1,3 +1,8 @@
+2019-08-20  Eric Botcazou  <ebotcazou@adacore.com>
+
+       * repinfo.adb (List_Record_Info): In -gnatR4 mode, set the
+       relevant flag on the implicit base type of a record subtype.
+
 2019-08-20  Bob Duff  <duff@adacore.com>
 
        * sem_eval.adb (Expr_Value): Implement the case of an unchecked
index 6f531b21348a440e7b1a742878136c941c52243d..0f318a0d65e0542e14bc9a86f5176b11ed5e6d2e 100644 (file)
@@ -1681,6 +1681,15 @@ package body Repinfo is
          Write_Eol;
          Write_Line ("}");
       end if;
+
+      --  The type is relevant for a record subtype
+
+      if List_Representation_Info = 4
+        and then not Is_Base_Type (Ent)
+        and then Is_Itype (Etype (Ent))
+      then
+         Relevant_Entities.Set (Etype (Ent), True);
+      end if;
    end List_Record_Info;
 
    -------------------