From: Piotr Trojanek <trojanek@adacore.com>
Code cleanup; behavior is unaffected. Flag Is_Inherited_Pragma is only set in
GNAT, but is not actually used, neither by the compiler nor by any backend.
gcc/ada/ChangeLog:
* contracts.adb (Inherit_Pragma): Don't set flag Is_Inherited_Pragma.
* gen_il-fields.ads (Opt_Field_Enum): Remove field identifier.
* gen_il-gen-gen_nodes.adb (N_Pragma): Remove field from node.
* sinfo.ads (Is_Inherited_Pragma): Remove field description.
(N_Pragma): Remove field reference.
Tested on x86_64-pc-linux-gnu, committed on master.
---
gcc/ada/contracts.adb | 8 ++------
gcc/ada/gen_il-fields.ads | 1 -
gcc/ada/gen_il-gen-gen_nodes.adb | 1 -
gcc/ada/sinfo.ads | 5 -----
4 files changed, 2 insertions(+), 13 deletions(-)
@@ -3593,8 +3593,7 @@ package body Contracts is
--------------------
procedure Inherit_Pragma (Prag_Id : Pragma_Id) is
- Prag : constant Node_Id := Get_Pragma (From_Subp, Prag_Id);
- New_Prag : Node_Id;
+ Prag : constant Node_Id := Get_Pragma (From_Subp, Prag_Id);
begin
-- A pragma cannot be part of more than one First_Pragma/Next_Pragma
@@ -3602,10 +3601,7 @@ package body Contracts is
-- flagged as inherited for distinction purposes.
if Present (Prag) then
- New_Prag := New_Copy_Tree (Prag);
- Set_Is_Inherited_Pragma (New_Prag);
-
- Add_Contract_Item (New_Prag, Subp);
+ Add_Contract_Item (New_Copy_Tree (Prag), Subp);
end if;
end Inherit_Pragma;
@@ -266,7 +266,6 @@ package Gen_IL.Fields is
Is_Ignored_Ghost_Pragma,
Is_Implicit_With,
Is_In_Discriminant_Check,
- Is_Inherited_Pragma,
Is_Initialization_Block,
Is_Interpolated_String_Literal,
Is_Known_Guaranteed_ABE,
@@ -1439,7 +1439,6 @@ begin -- Gen_IL.Gen.Gen_Nodes
Sm (Is_Generic_Contract_Pragma, Flag),
Sm (Is_Ignored, Flag),
Sm (Is_Ignored_Ghost_Pragma, Flag),
- Sm (Is_Inherited_Pragma, Flag),
Sm (Next_Pragma, Node_Id),
Sm (Next_Rep_Item, Node_Id),
Sm (Uneval_Old_Accept, Flag),
@@ -1763,10 +1763,6 @@ package Sinfo is
-- discriminant check has a correct value cannot be performed in this
-- case (or the discriminant check may be optimized away).
- -- Is_Inherited_Pragma
- -- This flag is set in an N_Pragma node that appears in a N_Contract node
- -- to indicate that the pragma has been inherited from a parent context.
-
-- Is_Initialization_Block
-- Defined in block nodes. Set when the block statement was created by
-- the finalization machinery to wrap initialization statements. This
@@ -2694,7 +2690,6 @@ package Sinfo is
-- Next_Rep_Item
-- Is_Generic_Contract_Pragma
-- Is_Checked_Ghost_Pragma
- -- Is_Inherited_Pragma
-- Is_Analyzed_Pragma
-- Class_Present set if from Aspect with 'Class
-- Uneval_Old_Accept