]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Remove Size_Check_Code field from entities
authorEric Botcazou <ebotcazou@adacore.com>
Thu, 13 Feb 2025 11:07:37 +0000 (12:07 +0100)
committerMarc Poulhiès <dkm@gcc.gnu.org>
Fri, 6 Jun 2025 08:37:04 +0000 (10:37 +0200)
It has been unused for a very long time.

gcc/ada/ChangeLog:

* einfo.ads (Size_Check_Code): Delete.
* gen_il-fields.ads (Opt_Field_Enum): Remove Size_Check_Code.
* gen_il-gen-gen_entities.adb (Constant_Or_Variable_Kind): Likewise.
* sem_ch13.adb (Analyze_Attribute_Definition_Clause): Remove call
to Kill_Size_Check_Code.
* sem_prag.adb (Analyze_Pragma): Likewise.
* sem_util.ads (Kill_Size_Check_Code): Delete.
* sem_util.adb (Kill_Size_Check_Code): Likewise.

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

index 1fce2f98b8f9fd6bed484a0582bb7ee2064f17d7..7a7765d1272de93c15d2cce5346ed51a298f36c1 100644 (file)
@@ -4388,11 +4388,6 @@ package Einfo is
 --       set, in which case this is the entity for the associated instance of
 --       System.Shared_Storage.Shared_Var_Procs. See Exp_Smem for full details.
 
---    Size_Check_Code
---       Defined in constants and variables. Normally Empty. Set if code is
---       generated to check the size of the object. This field is used to
---       suppress this code if a subsequent address clause is encountered.
-
 --    Size_Clause (synthesized)
 --       Applies to all entities. If a size or value size clause is present in
 --       the rep item chain for an entity then that attribute definition clause
@@ -5316,7 +5311,6 @@ package Einfo is
    --    Actual_Subtype
    --    Renamed_Object
    --    Renamed_Entity $$$
-   --    Size_Check_Code                       (constants only)
    --    Prival_Link                           (privals only)
    --    Interface_Name                        (constants only)
    --    Related_Type                          (constants only)
@@ -6202,7 +6196,6 @@ package Einfo is
    --    Renamed_Object
    --    Renamed_Entity $$$
    --    Discriminal_Link $$$
-   --    Size_Check_Code
    --    Prival_Link
    --    Interface_Name
    --    Shared_Var_Procs_Instance
index fe6d3387cfa955e06fe61ff37557aba4e2f246e6..f957f7f64327808245d811a0fecd187bce3edb24 100644 (file)
@@ -893,7 +893,6 @@ package Gen_IL.Fields is
       Scope_Depth_Value,
       Sec_Stack_Needed_For_Return,
       Shared_Var_Procs_Instance,
-      Size_Check_Code,
       Size_Depends_On_Discriminant,
       Size_Known_At_Compile_Time,
       Small_Value,
index 530af90853038cfa2aadd49e19eb3a8d46543d6e..85ab62a0af736183c9f5d12708ed008ca8800def 100644 (file)
@@ -357,7 +357,6 @@ begin -- Gen_IL.Gen.Gen_Entities
         Sm (Prival_Link, Node_Id),
         Sm (Related_Type, Node_Id),
         Sm (Return_Statement, Node_Id),
-        Sm (Size_Check_Code, Node_Id),
         Sm (SPARK_Pragma, Node_Id),
         Sm (SPARK_Pragma_Inherited, Flag)));
 
index 69e18b049b99755ed9c8111e4f62e1f905d03d59..de5716e6fd08e77f7ba4b648e8e7c5d20bffd36d 100644 (file)
@@ -6278,11 +6278,6 @@ package body Sem_Ch13 is
                   then
                      Set_Check_Address_Alignment (N);
                   end if;
-
-                  --  Kill the size check code, since we are not allocating
-                  --  the variable, it is somewhere else.
-
-                  Kill_Size_Check_Code (U_Ent);
                end;
 
             --  Not a valid entity for an address clause
index fafd27454d9e21d9819cf90dbd92e545e0216829..b37a9ad06a5485b97d64e4137098546fa6c56772 100644 (file)
@@ -10029,7 +10029,6 @@ package body Sem_Prag is
             end if;
 
             Def_Id := Entity (Def_Id);
-            Kill_Size_Check_Code (Def_Id);
             if Ekind (Def_Id) /= E_Constant then
                Note_Possible_Modification
                  (Get_Pragma_Arg (Arg1), Sure => False);
@@ -10042,7 +10041,6 @@ package body Sem_Prag is
             --  purposes of legality checks and removal of ignored Ghost code.
 
             Mark_Ghost_Pragma (N, Def_Id);
-            Kill_Size_Check_Code (Def_Id);
             if Ekind (Def_Id) /= E_Constant then
                Note_Possible_Modification
                  (Get_Pragma_Arg (Arg2), Sure => False);
@@ -19946,7 +19944,6 @@ package body Sem_Prag is
             --  object to be imported.
 
             if Ekind (Def_Id) = E_Variable then
-               Kill_Size_Check_Code (Def_Id);
                Note_Possible_Modification (Id, Sure => False);
 
                --  Initialization is not allowed for imported variable
index 97dc4c0af8b9ab6df1fff9e1d35a2320123eeb75..1196e09f2076e130b10b28eb1cbde4eeadc2b7a0 100644 (file)
@@ -21959,20 +21959,6 @@ package body Sem_Util is
       end loop Scope_Loop;
    end Kill_Current_Values;
 
-   --------------------------
-   -- Kill_Size_Check_Code --
-   --------------------------
-
-   procedure Kill_Size_Check_Code (E : Entity_Id) is
-   begin
-      if (Ekind (E) = E_Constant or else Ekind (E) = E_Variable)
-        and then Present (Size_Check_Code (E))
-      then
-         Remove (Size_Check_Code (E));
-         Set_Size_Check_Code (E, Empty);
-      end if;
-   end Kill_Size_Check_Code;
-
    --------------------
    -- Known_Non_Null --
    --------------------
index 167b0966dad2c03c8bf6f47c9173ccd784b2e177..c88724f8626a1a4cefc800b9d9b2b1fcabb4cda0 100644 (file)
@@ -2540,12 +2540,6 @@ package Sem_Util is
    --  if the entity Ent is not for an object. Last_Assignment_Only has the
    --  same meaning as for the call with no Ent.
 
-   procedure Kill_Size_Check_Code (E : Entity_Id);
-   --  Called when an address clause or pragma Import is applied to an entity.
-   --  If the entity is a variable or a constant, and size check code is
-   --  present, this size check code is killed, since the object will not be
-   --  allocated by the program.
-
    function Known_Non_Null (N : Node_Id) return Boolean;
    --  Given a node N for a subexpression of an access type, determines if
    --  this subexpression yields a value that is known at compile time to