]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Tweak documentation comments
authorRonan Desplanques <desplanques@adacore.com>
Mon, 25 Sep 2023 09:14:58 +0000 (11:14 +0200)
committerMarc Poulhiès <poulhies@adacore.com>
Tue, 10 Oct 2023 12:12:28 +0000 (14:12 +0200)
The concept of extended nodes was retired at the same time Gen_IL
was introduced, but there was a reference to that concept left over
in a comment. This patch removes that reference.

Also, the description of the field Comes_From_Check_Or_Contract was
incorrectly placed in a section for fields present in all nodes in
sinfo.ads. This patch fixes this.

gcc/ada/

* atree.ads, nlists.ads, types.ads: Remove references to extended
nodes. Fix typo.
* sinfo.ads: Likewise and fix position of
Comes_From_Check_Or_Contract description.

gcc/ada/atree.ads
gcc/ada/nlists.ads
gcc/ada/sinfo.ads
gcc/ada/types.ads

index abe5cc5f3b5c913f1cabc6451f72cf298dec57ea..2ff65d24679e0747130ff27011041953a26650a8 100644 (file)
@@ -252,7 +252,7 @@ package Atree is
    --  The usual approach is to build a new node using this function and
    --  then, using the value returned, use the Set_xxx functions to set
    --  fields of the node as required. New_Node can only be used for
-   --  non-entity nodes, i.e. it never generates an extended node.
+   --  non-entity nodes.
    --
    --  If we are currently parsing, as indicated by a previous call to
    --  Set_Comes_From_Source_Default (True), then this call also resets
@@ -308,8 +308,7 @@ package Atree is
    --  returns Empty, and New_Copy (Error) returns Error. Note that, unlike
    --  Copy_Separate_Tree, New_Copy does not recursively copy any descendants,
    --  so in general parent pointers are not set correctly for the descendants
-   --  of the copied node. Both normal and extended nodes (entities) may be
-   --  copied using New_Copy.
+   --  of the copied node.
 
    function Relocate_Node (Source : Node_Id) return Node_Id;
    --  Source is a non-entity node that is to be relocated. A new node is
@@ -359,7 +358,7 @@ package Atree is
    --  caller, according to context.
 
    procedure Extend_Node (Source : Node_Id);
-   --  This turns a node into an entity; it function is used only by Sinfo.CN.
+   --  This turns a node into an entity; it is only used by Sinfo.CN.
 
    type Ignored_Ghost_Record_Proc is access procedure (N : Node_Or_Entity_Id);
 
@@ -540,7 +539,7 @@ package Atree is
    --  newly constructed replacement subtree. The actual mechanism is to swap
    --  the contents of these two nodes fixing up the parent pointers of the
    --  replaced node (we do not attempt to preserve parent pointers for the
-   --  original node). Neither Old_Node nor New_Node can be extended nodes.
+   --  original node).
    --  ??? The above explanation is incorrect, instead Copy_Node is called.
    --
    --  Note: New_Node may not contain references to Old_Node, for example as
index 5e88032ff7d1ecf6ca39131a63e1dbd500b82650..7afe80f00519cd36402c76a350d29c854af2164b 100644 (file)
@@ -43,9 +43,6 @@ package Nlists is
    --  this header, which may be used to access the nodes in the list using
    --  the set of routines that define this interface.
 
-   --  Note: node lists can contain either nodes or entities (extended nodes)
-   --  or a mixture of nodes and extended nodes.
-
    function In_Same_List (N1, N2 : Node_Or_Entity_Id) return Boolean;
    pragma Inline (In_Same_List);
    --  Equivalent to List_Containing (N1) = List_Containing (N2)
index 57fd704475c36e649a723837a5b095467efe2d76..fc9bcfbd44db74984507c7f64940aeb0c62dea78 100644 (file)
@@ -82,12 +82,6 @@ package Sinfo is
    --                 for this purpose, so e.g. in X := (if A then B else C);
    --                 Paren_Count for the right side will be 1.
 
-   --   Comes_From_Check_Or_Contract
-   --                 This flag is present in all N_If_Statement nodes and
-   --                 gets set when an N_If_Statement is generated as part of
-   --                 the expansion of a Check, Assert, or contract-related
-   --                 pragma.
-
    --   Comes_From_Source
    --                 This flag is present in all nodes. It is set if the
    --                 node is built by the scanner or parser, and clear if
@@ -953,6 +947,12 @@ package Sinfo is
    --    attribute definition clause is given, rather than testing this at the
    --    freeze point.
 
+   --  Comes_From_Check_Or_Contract
+   --    This flag is present in all N_If_Statement nodes and
+   --    gets set when an N_If_Statement is generated as part of
+   --    the expansion of a Check, Assert, or contract-related
+   --    pragma.
+
    --  Comes_From_Extended_Return_Statement
    --    Present in N_Simple_Return_Statement nodes. True if this node was
    --    constructed as part of the N_Extended_Return_Statement expansion.
@@ -2809,12 +2809,6 @@ package Sinfo is
       --  fields are defined (and access subprograms declared) in package
       --  Einfo.
 
-      --  Note: N_Defining_Identifier is an extended node whose fields are
-      --  deliberately laid out to match the layout of fields in an ordinary
-      --  N_Identifier node allowing for easy alteration of an identifier
-      --  node into a defining identifier node. For details, see procedure
-      --  Sinfo.CN.Change_Identifier_To_Defining_Identifier.
-
       --  N_Defining_Identifier
       --  Sloc points to identifier
       --  Chars contains the Name_Id for the identifier
@@ -3156,12 +3150,6 @@ package Sinfo is
       --  additional fields are defined (and access subprograms declared)
       --  in package Einfo.
 
-      --  Note: N_Defining_Character_Literal is an extended node whose fields
-      --  are deliberately laid out to match layout of fields in an ordinary
-      --  N_Character_Literal node, allowing for easy alteration of a character
-      --  literal node into a defining character literal node. For details, see
-      --  Sinfo.CN.Change_Character_Literal_To_Defining_Character_Literal.
-
       --  N_Defining_Character_Literal
       --  Sloc points to literal
       --  Chars contains the Name_Id for the identifier
@@ -5416,13 +5404,6 @@ package Sinfo is
       --  additional fields are defined (and access subprograms declared)
       --  in package Einfo.
 
-      --  Note: N_Defining_Operator_Symbol is an extended node whose fields
-      --  are deliberately laid out to match the layout of fields in an
-      --  ordinary N_Operator_Symbol node allowing for easy alteration of
-      --  an operator symbol node into a defining operator symbol node.
-      --  See Sinfo.CN.Change_Operator_Symbol_To_Defining_Operator_Symbol
-      --  for further details.
-
       --  N_Defining_Operator_Symbol
       --  Sloc points to literal
       --  Chars contains the Name_Id for the operator symbol
index c10f4046bacd85c2265aa5d750dba039449c0b2a..b7612bfbe367f1ce4de28e0f619e4a484f0bff44 100644 (file)
@@ -405,9 +405,7 @@ package Types is
 
    subtype Entity_Id is Node_Id;
    --  A synonym for node types, used in the Einfo package to refer to nodes
-   --  that are entities (i.e. nodes with an Nkind of N_Defining_xxx). All such
-   --  nodes are extended nodes and these are the only extended nodes, so that
-   --  in practice entity and extended nodes are synonymous.
+   --  that are entities (i.e. nodes with an Nkind of N_Defining_xxx).
    --
    --  Note that Sinfo.Nodes.N_Entity_Id is the same as Entity_Id, except it
    --  has a predicate requiring the correct Nkind. Opt_N_Entity_Id is the same