]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Get rid of unused node/entity fields (Set_ only)
authorBob Duff <duff@adacore.com>
Wed, 8 Oct 2025 16:29:35 +0000 (12:29 -0400)
committerMarc Poulhiès <dkm@gcc.gnu.org>
Mon, 3 Nov 2025 14:15:15 +0000 (15:15 +0100)
The following fields are Set_ but not used in GNAT. We get rid of them
or document them as follows:

    - Has_Pragma_Controlled
Remove.
    - Corresponding_Entry_Body
Document that it is used by codepeer.
    - Is_Activation_Record
Document that it is used by llvm.
    - Is_Discriminant_Check_Function
Document that it is used by codepeer.
    - Original_Access_Type
No change (already documented that it is used by codepeer).

gcc/ada/ChangeLog:

* einfo.ads (Has_Pragma_Controlled): Remove.
(Is_Activation_Record): Document usage by llvm.
* gen_il-fields.ads (Opt_Field_Enum):
Remove Has_Pragma_Controlled.
* gen_il-gen-gen_entities.adb (Access_Kind):
Remove Has_Pragma_Controlled.
* sem_prag.adb:
Remove setting of Has_Pragma_Controlled.
* sinfo.ads (Corresponding_Entry_Body):
Document usage by codepeer.

gcc/ada/einfo.ads
gcc/ada/gen_il-fields.ads
gcc/ada/gen_il-gen-gen_entities.adb
gcc/ada/sem_prag.adb
gcc/ada/sinfo.ads

index cd00fe265e154845333ec7e6a818246c81b0e367..da6a0286d9e529a3c3e70141560225ae839b9f7c 100644 (file)
@@ -1889,10 +1889,6 @@ package Einfo is
 --       5. N_Range_Constraint - when the range expression uses the
 --          discriminant of the enclosing type.
 
---    Has_Pragma_Controlled [implementation base type only]
---       Defined in access type entities. It is set if a pragma Controlled
---       applies to the access type.
-
 --    Has_Pragma_Elaborate_Body
 --       Defined in all entities. Set in compilation unit entities if a
 --       pragma Elaborate_Body applies to the compilation unit.
@@ -2383,7 +2379,7 @@ package Einfo is
 --    Is_Activation_Record
 --       Applies to E_In_Parameters generated in Exp_Unst for nested
 --       subprograms, to mark the added formal that carries the activation
---       record created in the enclosing subprogram.
+--       record created in the enclosing subprogram. Used by the llvm back end.
 
 --    Is_Actual_Subtype
 --       Defined on all types, true for the generated constrained subtypes
@@ -2596,7 +2592,7 @@ package Einfo is
 
 --    Is_Discriminant_Check_Function
 --       Defined in all entities. Set only in E_Function entities for functions
---       created to do discriminant checks.
+--       created to do discriminant checks. Used by CodePeer.
 
 --    Is_Discriminal (synthesized)
 --       Applies to all entities, true for renamings of discriminants. Such
@@ -5220,7 +5216,6 @@ package Einfo is
    --    Associated_Storage_Pool               (root type only)
    --    Finalization_Collection               (root type only)
    --    Storage_Size_Variable                 (base type only)
-   --    Has_Pragma_Controlled                 (base type only)
    --    Has_Storage_Size_Clause               (base type only)
    --    Is_Access_Constant
    --    Is_Local_Anonymous_Access
index 5e954186e05c202dbbed154072690e9ed3cf3f57..d6681010ccb216a649c1734da44555fc4774444b 100644 (file)
@@ -614,7 +614,6 @@ package Gen_IL.Fields is
       Has_Own_Invariants,
       Has_Partial_Visible_Refinement,
       Has_Per_Object_Constraint,
-      Has_Pragma_Controlled,
       Has_Pragma_Elaborate_Body,
       Has_Pragma_Inline,
       Has_Pragma_Inline_Always,
index 95b172ad5f14e304b383655e9bb2566f683812f7..f13488bee3c349d786f247f81790711dd5fc0f16 100644 (file)
@@ -647,7 +647,6 @@ begin -- Gen_IL.Gen.Gen_Entities
        (Sm (Associated_Storage_Pool, Node_Id, Root_Type_Only),
         Sm (Directly_Designated_Type, Node_Id),
         Sm (Finalization_Collection, Node_Id, Root_Type_Only),
-        Sm (Has_Pragma_Controlled, Flag, Impl_Base_Type_Only),
         Sm (Has_Storage_Size_Clause, Flag, Impl_Base_Type_Only),
         Sm (Is_Access_Constant, Flag),
         Sm (Is_Local_Anonymous_Access, Flag),
index 0dc2e4f56bf104ea7c966ec79c5e7d44a86f5532..0ebf421fc96f9bcb3b65d4d693308bb9a5b235ac 100644 (file)
@@ -16449,8 +16449,6 @@ package body Sem_Prag is
               or else not Is_Access_Type (Entity (Arg))
             then
                Error_Pragma_Arg ("pragma% requires access type", Arg1);
-            else
-               Set_Has_Pragma_Controlled (Base_Type (Entity (Arg)));
             end if;
          end Controlled;
 
index a1a850adb4af63c8a1a672fbcd6670feceeabcd5..d5677095468ba650aea0a54bc84383faad5b1440 100644 (file)
@@ -1003,9 +1003,10 @@ package Sinfo is
    --    to the defining entity for the corresponding body (NOT the node for
    --    the body itself).
 
-   --    Corresponding_Entry_Body
+   --  Corresponding_Entry_Body
    --    Defined in N_Subprogram_Body. Set for subprogram bodies that implement
    --    a protected type entry; points to the body for the entry.
+   --    Used by codepeer.
 
    --  Corresponding_Formal_Spec
    --    This field is set in subprogram renaming declarations, where it points