summaryrefslogtreecommitdiff
path: root/gcc/ada/atree.ads
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/ada/atree.ads')
-rw-r--r--gcc/ada/atree.ads36
1 files changed, 20 insertions, 16 deletions
diff --git a/gcc/ada/atree.ads b/gcc/ada/atree.ads
index 6538a19cf6c..4e20b0b0f00 100644
--- a/gcc/ada/atree.ads
+++ b/gcc/ada/atree.ads
@@ -435,10 +435,15 @@ package Atree is
-- whose parent field references a copied node (descendants not linked to
-- a copied node by the parent field are also copied.) The parent pointers
-- in the copy are properly set. Copy_Separate_Tree (Empty/Error) returns
- -- Empty/Error. The semantic fields are not copied and the new subtree
- -- does not share any entity with source subtree.
- -- But the code *does* copy semantic fields, and the description above
- -- is in any case unclear on this point ??? (RBKD)
+ -- Empty/Error. The new subtree does not share entities with the source,
+ -- but has new entities with the same name. Most of the time this routine
+ -- is called on an unanalyzed tree, and no semantic information is copied.
+ -- However, to ensure that no entities are shared between the two when the
+ -- source is already analyzed, entity fields in the copy are zeroed out.
+
+ function Copy_Separate_List (Source : List_Id) return List_Id;
+ -- Applies Copy_Separate_Tree to each element of the Source list, returning
+ -- a new list of the results of these copy operations.
procedure Exchange_Entities (E1 : Entity_Id; E2 : Entity_Id);
-- Exchange the contents of two entities. The parent pointers are switched
@@ -449,16 +454,15 @@ package Atree is
-- two entities may be list members.
function Extend_Node (Node : Node_Id) return Entity_Id;
- -- This function returns a copy of its input node with an extension
- -- added. The fields of the extension are set to Empty. Due to the way
- -- extensions are handled (as four consecutive array elements), it may
- -- be necessary to reallocate the node, so that the returned value is
- -- not the same as the input value, but where possible the returned
- -- value will be the same as the input value (i.e. the extension will
- -- occur in place). It is the caller's responsibility to ensure that
- -- any pointers to the original node are appropriately updated. This
- -- function is used only by Sinfo.CN to change nodes into their
- -- corresponding entities.
+ -- This function returns a copy of its input node with an extension added.
+ -- The fields of the extension are set to Empty. Due to the way extensions
+ -- are handled (as four consecutive array elements), it may be necessary
+ -- to reallocate the node, so that the returned value is not the same as
+ -- the input value, but where possible the returned value will be the same
+ -- as the input value (i.e. the extension will occur in place). It is the
+ -- caller's responsibility to ensure that any pointers to the original node
+ -- are appropriately updated. This function is used only by Sinfo.CN to
+ -- change nodes into their corresponding entities.
type Report_Proc is access procedure (Target : Node_Id; Source : Node_Id);
@@ -475,7 +479,7 @@ package Atree is
-- the results of Process calls. See below for details.
generic
- with function Process (N : Node_Id) return Traverse_Result is <>;
+ with function Process (N : Node_Id) return Traverse_Result is <>;
function Traverse_Func (Node : Node_Id) return Traverse_Final_Result;
-- This is a generic function that, given the parent node for a subtree,
-- traverses all syntactic nodes of this tree, calling the given function
@@ -501,7 +505,7 @@ package Atree is
-- all calls to process returned either OK, OK_Orig, or Skip).
generic
- with function Process (N : Node_Id) return Traverse_Result is <>;
+ with function Process (N : Node_Id) return Traverse_Result is <>;
procedure Traverse_Proc (Node : Node_Id);
pragma Inline (Traverse_Proc);
-- This is the same as Traverse_Func except that no result is returned,