]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[Ada] Add N_Is_Decl
authorRichard Kenner <kenner@adacore.com>
Sat, 7 Aug 2021 13:21:32 +0000 (09:21 -0400)
committerPierre-Marie de Rodat <derodat@adacore.com>
Fri, 1 Oct 2021 06:13:35 +0000 (06:13 +0000)
gcc/ada/

* gen_il-gen-gen_nodes.adb (N_Is_Decl): Add.
* gen_il-types.ads (N_Is_Decl): Likewise.

gcc/ada/gen_il-gen-gen_nodes.adb
gcc/ada/gen_il-types.ads

index 32cc89a081a8adfabed76a221393fe36d221da25..2d226bfb443989d05f735f5b90408589eaf65517 100644 (file)
@@ -577,7 +577,8 @@ begin -- Gen_IL.Gen.Gen_Nodes
 
    Ab (N_Declaration, Node_Kind);
    --  Note: this includes all constructs normally thought of as declarations
-   --  except those that are separately grouped in N_Later_Decl_Item.
+   --  except those that are separately grouped in N_Later_Decl_Item. But
+   --  Declaration_Node may return yet more node types; see N_Is_Decl below.
 
    Cc (N_Component_Declaration, N_Declaration,
        (Sy (Defining_Identifier, Node_Id),
@@ -1672,4 +1673,17 @@ begin -- Gen_IL.Gen.Gen_Nodes
    --  Some N_Attribute_Reference nodes may also represent an entity. See
    --  Is_Entity_Name.
 
+   Union (N_Is_Decl,
+          Children =>
+            (N_Declaration,
+             N_Discriminant_Specification,
+             N_Enumeration_Type_Definition,
+             N_Exception_Handler,
+             N_Later_Decl_Item,
+             N_Package_Specification,
+             N_Parameter_Specification,
+             N_Renaming_Declaration,
+             N_Subprogram_Specification));
+   --  Nodes that can be returned by Declaration_Node
+
 end Gen_IL.Gen.Gen_Nodes;
index 4aadf99cf776e6fba39fa4c2f3e553ab0f7103fb..f7de1501874de3af9a72a9e0190a14414e63e24a 100644 (file)
@@ -94,6 +94,7 @@ package Gen_IL.Types is
       N_Has_Condition,
       N_Has_Entity,
       N_Has_Etype,
+      N_Is_Decl,
       N_Is_Index,
       N_Multiplying_Operator,
       N_Later_Decl_Item,