]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Document representation clauses previously required by ASIS
authorPiotr Trojanek <trojanek@adacore.com>
Tue, 25 Feb 2025 11:48:32 +0000 (12:48 +0100)
committerMarc Poulhiès <dkm@gcc.gnu.org>
Fri, 6 Jun 2025 08:37:09 +0000 (10:37 +0200)
A record type used for name identifiers had representation clause to make sure
that table with identifiers is written to an ASIS file without holes. Now ASIS
mode has been deconstructed, but we still want this representation clause to
ensure efficient implementation.

Comment update; behavior is unaffected.

gcc/ada/ChangeLog:

* namet.ads (Name_Entry): Update comments to explain the current needs.

gcc/ada/namet.ads

index daa87d91caa637c51a3f3b7e02bcd78791abfdfc..7182fb87e7ec9213f3e2d799a0a6270d12cbc03a 100644 (file)
@@ -609,6 +609,7 @@ private
       --  Int Value associated with this name
 
    end record;
+   --  The aliased non-boolean components are required to match the C structure
 
    for Name_Entry use record
       Name_Chars_Index      at  0 range 0 .. 31;
@@ -622,9 +623,10 @@ private
       Hash_Link             at  8 range 0 .. 31;
       Int_Info              at 12 range 0 .. 31;
    end record;
+   --  This ensures a matching layout between Ada and C
 
    for Name_Entry'Size use 16 * 8;
-   --  This ensures that we did not leave out any fields
+   --  This ensures that record is reasonably small
 
    --  This is the table that is referenced by Valid_Name_Id entries.
    --  It contains one entry for each unique name in the table.