diff options
author | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-12-13 10:22:06 +0000 |
---|---|---|
committer | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-12-13 10:22:06 +0000 |
commit | d34432fafd1efc1b4aa0aba79a38b633af6c1daa (patch) | |
tree | c68ed79f7c2a4dc0ccf8b7d714f6a24bc37734fb /gcc/ada/sinfo.ads | |
parent | 774a0827682ade189dd9fe45fd43fce6bba2e6ef (diff) | |
download | gcc-d34432fafd1efc1b4aa0aba79a38b633af6c1daa.tar.gz |
2007-12-06 Robert Dewar <dewar@adacore.com>
* atree.adb (Flag231..Flag247): New functions
(Set_Flag231..Set_Flag247): New procedures
(Basic_Set_Convention): Rename Set_Convention to be
Basic_Set_Convention
(Nkind_In): New functions
Remove Atree.Delete_Tree/Delete_Node and Nlist.Delete_List
* exp_ch6.adb (Expand_Call): Use new flag Has_Pragma_Inline_Always
instead
of obsolete function Is_Always_Inlined
(Register_Predefined_DT_Entry): Initialize slots of the second
secondary dispatch table.
Remove Atree.Delete_Tree/Delete_Node and Nlist.Delete_List
(Expand_N_Function_Call): Remove special provision for stack checking.
* exp_util.ads, exp_util.adb (Is_Predefined_Dispatching_Operation):
Include _Disp_Requeue in the list of predefined operations.
(Find_Interface_ADT): Modified to fulfill the new specification.
Remove Atree.Delete_Tree/Delete_Node and Nlist.Delete_List
* par-ch4.adb, nlists.ads, nlists.adb:
Remove Atree.Delete_Tree/Delete_Node and Nlist.Delete_List
* sinfo.ads, sinfo.adb: (Nkind_In): New functions
Fix location of flag for unrecognized pragma message
* sem_ch7.adb: Use Nkind_In
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@130820 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/sinfo.ads')
-rw-r--r-- | gcc/ada/sinfo.ads | 158 |
1 files changed, 127 insertions, 31 deletions
diff --git a/gcc/ada/sinfo.ads b/gcc/ada/sinfo.ads index 61a1400369e..d1f20176768 100644 --- a/gcc/ada/sinfo.ads +++ b/gcc/ada/sinfo.ads @@ -549,9 +549,11 @@ package Sinfo is -- Acts_As_Spec (Flag4-Sem) -- A flag set in the N_Subprogram_Body node for a subprogram body which - -- is acting as its own spec. This flag also appears in the compilation - -- unit node at the library level for such a subprogram (see further - -- description in spec of Lib package). + -- is acting as its own spec, except in the case of a library level + -- subprogram, in which case the flag is set on the parent compilation + -- unit node instead (see further description in spec of Lib package). + -- ??? Above note about Lib is dubious since lib.ads does not mention + -- Acts_As_Spec at all. -- Actual_Designated_Subtype (Node4-Sem) -- Present in N_Free_Statement and N_Explicit_Dereference nodes. If gigi @@ -907,27 +909,36 @@ package Sinfo is -- processing of the variant part of a record type. -- Entity (Node4-Sem) - -- Appears in all direct names (identifier, character literal, operator - -- symbol), as well as expanded names, and attributes that denote - -- entities, such as 'Class. Points to the entity for the corresponding - -- defining occurrence. Set after name resolution. In the case of - -- identifiers in a WITH list, the corresponding defining occurrence is - -- in a separately compiled file, and this pointer must be set using the - -- library Load procedure. Note that during name resolution, the value in - -- Entity may be temporarily incorrect (e.g. during overload resolution, - -- Entity is initially set to the first possible correct interpretation, - -- and then later modified if necessary to contain the correct value - -- after resolution). Note that this field overlaps Associated_Node, - -- which is used during generic processing (see Sem_Ch12 for details). - -- Note also that in generic templates, this means that the Entity field - -- does not always point to an Entity. Since the back end is expected to - -- ignore generic templates, this is harmless. Note that this field also - -- appears in N_Attribute_Definition_Clause nodes. It is used only for - -- stream attributes definition clauses. In this case, it denotes a - -- (possibly dummy) subprogram entity that is conceptually declared at - -- the point of the clause. Thus the visibility of the attribute - -- definition clause (in the sense of 8.3(23) as amended by AI-195) can - -- be checked by testing the visibility of that subprogram. + -- Appears in all direct names (identifiers, character literals, and + -- operator symbols), as well as expanded names, and attributes that + -- denote entities, such as 'Class. Points to entity for corresponding + -- defining occurrence. Set after name resolution. For identifiers in a + -- WITH list, the corresponding defining occurrence is in a separately + -- compiled file, and Entity must be set by the library Load procedure. + -- + -- Note: During name resolution, the value in Entity may be temporarily + -- incorrect (e.g. during overload resolution, Entity is initially set to + -- the first possible correct interpretation, and then later modified if + -- necessary to contain the correct value after resolution). + -- + -- Note: This field overlaps Associated_Node, which is used during + -- generic processing (see Sem_Ch12 for details). Note also that in + -- generic templates, this means that the Entity field does not always + -- point to an Entity. Since the back end is expected to ignore generic + -- templates, this is harmless. + -- + -- Note: This field also appears in N_Attribute_Definition_Clause nodes. + -- It is used only for stream attributes definition clauses. In this + -- case, it denotes a (possibly dummy) subprogram entity that is declared + -- conceptually at the point of the clause. Thus the visibility of the + -- attribute definition clause (in the sense of 8.3(23) as amended by + -- AI-195) can be checked by testing the visibility of that subprogram. + -- + -- Note: Normally the Entity field of an identifier points to the entity + -- for the corresponding defining identifier, and hence the Chars field + -- of an identifier will match the Chars field of the entity. However, + -- there is no requirement that these match, and there are obscure cases + -- of generated code where they do not match. -- Entity_Or_Associated_Node (Node4-Sem) -- A synonym for both Entity and Associated_Node. Used by convention in @@ -1070,7 +1081,7 @@ package Sinfo is -- in the non-generic package case if it determines that no elaboration -- code is generated. Note that this flag is not related to the -- Is_Preelaborated status, there can be preelaborated packages that - -- generate elaboration code, and non- preelaborated packages which do + -- generate elaboration code, and non-preelaborated packages which do -- not generate elaboration code. -- Has_Priority_Pragma (Flag6-Sem) @@ -1864,10 +1875,11 @@ package Sinfo is -- which are explicitly documented. -- N_Pragma - -- Sloc points to PRAGMA + -- Sloc points to pragma identifier -- Chars (Name1) identifier name from pragma identifier -- Pragma_Argument_Associations (List2) (set to No_List if none) -- Debug_Statement (Node3) (set to Empty if not Debug, Assert) + -- Pragma_Identifier (Node4) -- Next_Rep_Item (Node5-Sem) -- Note: we should have a section on what pragmas are passed on to @@ -1875,6 +1887,13 @@ package Sinfo is -- Psect_Object is always converted to Common_Object, but there are -- undoubtedly many other similar notes required ??? + -- Note: we don't really need the Chars field, since it can trivially + -- be obtained as Chars (Pragma_Identifier (Node)). However, it is + -- convenient to have this directly available, and historically the + -- Chars field has been around for ever, whereas the Pragma_Identifier + -- field was added much later (when we found the need to be able to get + -- the Sloc of the pragma identifier). + -------------------------------------- -- 2.8 Pragma Argument Association -- -------------------------------------- @@ -3232,9 +3251,9 @@ package Sinfo is -- component_SELECTOR_NAME {| component_SELECTOR_NAME} -- | others - -- The entries of a component choice list appear in the Choices list - -- of the associated N_Component_Association, as either selector - -- names, or as an N_Others_Choice node. + -- The entries of a component choice list appear in the Choices list of + -- the associated N_Component_Association, as either selector names, or + -- as an N_Others_Choice node. -------------------------------- -- 4.3.2 Extension Aggregate -- @@ -7385,7 +7404,7 @@ package Sinfo is subtype N_Unit_Body is Node_Kind range N_Package_Body .. - N_Subprogram_Body; + N_Subprogram_Body; --------------------------- -- Node Access Functions -- @@ -8071,6 +8090,9 @@ package Sinfo is function Pragma_Argument_Associations (N : Node_Id) return List_Id; -- List2 + function Pragma_Identifier + (N : Node_Id) return Node_Id; -- Node4 + function Pragmas_After (N : Node_Id) return List_Id; -- List5 @@ -8935,6 +8957,9 @@ package Sinfo is procedure Set_Pragma_Argument_Associations (N : Node_Id; Val : List_Id); -- List2 + procedure Set_Pragma_Identifier + (N : Node_Id; Val : Node_Id); -- Node4 + procedure Set_Pragmas_After (N : Node_Id; Val : List_Id); -- List5 @@ -9144,6 +9169,75 @@ package Sinfo is -- other words, End_Span is set to the difference between S and -- Sloc (N), the starting location. + -------------------------------- + -- Node_Kind Membership Tests -- + -------------------------------- + + -- The following functions allow a convenient notation for testing wheter + -- a Node_Kind value matches any one of a list of possible values. In each + -- case True is returned if the given T argument is equal to any of the V + -- arguments. Note that there is a similar set of functions defined in + -- Atree where the first argument is a Node_Id whose Nkind field is tested. + + function Nkind_In + (T : Node_Kind; + V1 : Node_Kind; + V2 : Node_Kind) return Boolean; + + function Nkind_In + (T : Node_Kind; + V1 : Node_Kind; + V2 : Node_Kind; + V3 : Node_Kind) return Boolean; + + function Nkind_In + (T : Node_Kind; + V1 : Node_Kind; + V2 : Node_Kind; + V3 : Node_Kind; + V4 : Node_Kind) return Boolean; + + function Nkind_In + (T : Node_Kind; + V1 : Node_Kind; + V2 : Node_Kind; + V3 : Node_Kind; + V4 : Node_Kind; + V5 : Node_Kind) return Boolean; + + function Nkind_In + (T : Node_Kind; + V1 : Node_Kind; + V2 : Node_Kind; + V3 : Node_Kind; + V4 : Node_Kind; + V5 : Node_Kind; + V6 : Node_Kind) return Boolean; + + function Nkind_In + (T : Node_Kind; + V1 : Node_Kind; + V2 : Node_Kind; + V3 : Node_Kind; + V4 : Node_Kind; + V5 : Node_Kind; + V6 : Node_Kind; + V7 : Node_Kind) return Boolean; + + function Nkind_In + (T : Node_Kind; + V1 : Node_Kind; + V2 : Node_Kind; + V3 : Node_Kind; + V4 : Node_Kind; + V5 : Node_Kind; + V6 : Node_Kind; + V7 : Node_Kind; + V8 : Node_Kind) return Boolean; + + pragma Inline (Nkind_In); + -- Inline all above functions + ----------------------------- -- Syntactic Parent Tables -- ----------------------------- @@ -9198,7 +9292,7 @@ package Sinfo is (1 => True, -- Chars (Name1) 2 => True, -- Pragma_Argument_Associations (List2) 3 => True, -- Debug_Statement (Node3) - 4 => False, -- Entity (Node4-Sem) + 4 => True, -- Pragma_Identifier (Node4) 5 => False), -- Next_Rep_Item (Node5-Sem) N_Pragma_Argument_Association => @@ -10912,6 +11006,7 @@ package Sinfo is pragma Inline (Parent_Spec); pragma Inline (Position); pragma Inline (Pragma_Argument_Associations); + pragma Inline (Pragma_Identifier); pragma Inline (Pragmas_After); pragma Inline (Pragmas_Before); pragma Inline (Prefix); @@ -11196,6 +11291,7 @@ package Sinfo is pragma Inline (Set_Parent_Spec); pragma Inline (Set_Position); pragma Inline (Set_Pragma_Argument_Associations); + pragma Inline (Set_Pragma_Identifier); pragma Inline (Set_Pragmas_After); pragma Inline (Set_Pragmas_Before); pragma Inline (Set_Prefix); |