This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[Ada] Reflect missed ACT updates in sem_ch12.adb
- From: Geert Bosch <bosch at darwin dot gnat dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Wed, 12 Dec 2001 18:51:53 -0500 (EST)
- Subject: [Ada] Reflect missed ACT updates in sem_ch12.adb
Tested on sparc-sun-solaris2.8.
2001-12-12 Ed Schonberg <schonber@gnat.com>
* sem_ch12.adb (Save_Entity_Descendant): Use syntactic field names
on known node types, rather than untyped fields. Further cleanups.
2001-12-12 Robert Dewar <dewar@gnat.com>
* sem_ch12.adb:
(Save_Entity_Descendant): Minor comment update.
(Copy_Generic_Node): Deal with incorrect reference to Associated_Node
of an N_Attribute_Reference node. As per note below, this does not
eliminate need for Associated_Node in attribute ref nodes.
(Associated_Node): Documentation explicitly mentions attribute
reference nodes, since this field is used in such nodes.
* sem_ch12.adb (Associated_Node): Minor documentation cleanup.
*** sem_ch12.adb 2001/10/08 13:42:22 1.787
--- sem_ch12.adb 2001/10/08 22:53:15 1.788
***************
*** 8438,8451 ****
-----------------------------
procedure Save_Entity_Descendants (N : Node_Id) is
! use Atree.Unchecked_Access;
! -- This code section is part of the implementation of an untyped
! -- tree traversal, so it needs direct access to node fields.
! begin
! Save_Global_Descendant (Field2 (N));
! Save_Global_Descendant (Field3 (N));
end Save_Entity_Descendants;
--------------------------
--- 8438,8462 ----
-----------------------------
procedure Save_Entity_Descendants (N : Node_Id) is
+ begin
+ case Nkind (N) is
+ when N_Binary_Op =>
+ Save_Global_Descendant (Union_Id (Left_Opnd (N)));
+ Save_Global_Descendant (Union_Id (Right_Opnd (N)));
+
+ when N_Unary_Op =>
+ Save_Global_Descendant (Union_Id (Right_Opnd (N)));
+
+ when N_Expanded_Name | N_Selected_Component =>
+ Save_Global_Descendant (Union_Id (Prefix (N)));
+ Save_Global_Descendant (Union_Id (Selector_Name (N)));
! when N_Identifier | N_Character_Literal | N_Operator_Symbol =>
! null;
! when others =>
! raise Program_Error;
! end case;
end Save_Entity_Descendants;
--------------------------
***************
*** 8704,8712 ****
end if;
end if;
! -- Complete the check on operands
! Save_Entity_Descendants (N);
elsif Nkind (N) = N_Identifier then
if Nkind (N) = Nkind (Get_Associated_Node (N)) then
--- 8715,8726 ----
end if;
end if;
! -- Complete the check on operands, if node has not been
! -- constant-folded.
! if Nkind (N) in N_Op then
! Save_Entity_Descendants (N);
! end if;
elsif Nkind (N) = N_Identifier then
if Nkind (N) = Nkind (Get_Associated_Node (N)) then
*** sem_ch12.adb 2001/10/08 22:53:15 1.788
--- sem_ch12.adb 2001/10/14 10:09:38 1.789
***************
*** 534,541 ****
-- Three kinds of source nodes have associated nodes:
! -- a) those that contain entities, that is to say identifiers,
! -- expanded_names, and operators (N_Has_Entity)
-- b) aggregates (N_Aggregate and N_Extension_Aggregate)
--- 534,542 ----
-- Three kinds of source nodes have associated nodes:
! -- a) those that denote entities, that is to say identifiers,
! -- expanded_names, operators, and attribute reference nodes.
! -- These nodes have an Entity field (and are in N_Has_Entity).
-- b) aggregates (N_Aggregate and N_Extension_Aggregate)
***************
*** 4645,4650 ****
--- 4646,4652 ----
elsif Nkind (N) = N_Allocator
and then Nkind (Expression (N)) = N_Qualified_Expression
+ and then Is_Entity_Name (Subtype_Mark (Expression (N)))
and then Instantiating
then
declare
***************
*** 8207,8214 ****
procedure Save_Entity_Descendants (N : Node_Id);
-- Apply Save_Global_References to the two syntactic descendants of
! -- nodes that carry entities, i.e. identifiers, character literals,
! -- expanded names, and operators.
procedure Save_Global_Defaults (N1, N2 : Node_Id);
-- Default actuals in nested instances must be handled specially
--- 8210,8222 ----
procedure Save_Entity_Descendants (N : Node_Id);
-- Apply Save_Global_References to the two syntactic descendants of
! -- non-terminal nodes that carry an Associated_Node and are processed
! -- through Reset_Entity. Once the global entity (if any) has been
! -- captured together with its type, only two syntactic descendants
! -- need to be traversed to complete the processing of the tree rooted
! -- at N. This applies to Selected_Components, Expanded_Names, and to
! -- Operator nodes. N can also be a character literal, identifier, or
! -- operator symbol node, but the call has no effect in these cases.
procedure Save_Global_Defaults (N1, N2 : Node_Id);
-- Default actuals in nested instances must be handled specially
*** sem_ch12.adb 2001/10/14 10:09:38 1.789
--- sem_ch12.adb 2001/10/14 14:08:26 1.790
***************
*** 534,542 ****
-- Three kinds of source nodes have associated nodes:
! -- a) those that denote entities, that is to say identifiers,
! -- expanded_names, operators, and attribute reference nodes.
! -- These nodes have an Entity field (and are in N_Has_Entity).
-- b) aggregates (N_Aggregate and N_Extension_Aggregate)
--- 534,543 ----
-- Three kinds of source nodes have associated nodes:
! -- a) those that can reference (denote) entities, that is identifiers,
! -- character literals, expanded_names, operator symbols, operators,
! -- and attribute reference nodes. These nodes have an Entity field
! -- and are the set of nodes that are in N_Has_Entity.
-- b) aggregates (N_Aggregate and N_Extension_Aggregate)