public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [COMMITTED] ada: Tweak documentation comments
@ 2023-10-10 12:14 Marc Poulhiès
  0 siblings, 0 replies; only message in thread
From: Marc Poulhiès @ 2023-10-10 12:14 UTC (permalink / raw)
  To: gcc-patches; +Cc: Ronan Desplanques

From: Ronan Desplanques <desplanques@adacore.com>

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.

Tested on x86_64-pc-linux-gnu, committed on master.

---
 gcc/ada/atree.ads  |  9 ++++-----
 gcc/ada/nlists.ads |  3 ---
 gcc/ada/sinfo.ads  | 31 ++++++-------------------------
 gcc/ada/types.ads  |  4 +---
 4 files changed, 11 insertions(+), 36 deletions(-)

diff --git a/gcc/ada/atree.ads b/gcc/ada/atree.ads
index abe5cc5f3b5..2ff65d24679 100644
--- a/gcc/ada/atree.ads
+++ b/gcc/ada/atree.ads
@@ -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
diff --git a/gcc/ada/nlists.ads b/gcc/ada/nlists.ads
index 5e88032ff7d..7afe80f0051 100644
--- a/gcc/ada/nlists.ads
+++ b/gcc/ada/nlists.ads
@@ -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)
diff --git a/gcc/ada/sinfo.ads b/gcc/ada/sinfo.ads
index 57fd704475c..fc9bcfbd44d 100644
--- a/gcc/ada/sinfo.ads
+++ b/gcc/ada/sinfo.ads
@@ -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
diff --git a/gcc/ada/types.ads b/gcc/ada/types.ads
index c10f4046bac..b7612bfbe36 100644
--- a/gcc/ada/types.ads
+++ b/gcc/ada/types.ads
@@ -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
-- 
2.42.0


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-10-10 12:14 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-10 12:14 [COMMITTED] ada: Tweak documentation comments Marc Poulhiès

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).