+2019-08-12 Yannick Moy <moy@adacore.com>
+
+ * sem_util.adb, sem_util.ads (Traverse_More_Func,
+ Traverse_More_Proc): Add formal parameter for Itypes traversal.
+
2019-08-12 Yannick Moy <moy@adacore.com>
* exp_attr.adb, exp_attr.ads (Expand_Size_Attribute): New
null;
end case;
- -- Then process unattached nodes which come from Itypes. This only
- -- concerns currently ranges of scalar (possibly as index) types.
- -- This traversal is protected against looping with Processing_Itype.
+ -- If Process_Itypes is True, process unattached nodes which come
+ -- from Itypes. This only concerns currently ranges of scalar
+ -- (possibly as index) types. This traversal is protected against
+ -- looping with Processing_Itype.
- if not Processing_Itype
+ if Process_Itypes
+ and then not Processing_Itype
and then Nkind (Node) in N_Has_Etype
and then Present (Etype (Node))
and then Is_Itype (Etype (Node))
------------------------
procedure Traverse_More_Proc (Node : Node_Id) is
- function Traverse is new Traverse_More_Func (Process);
+ function Traverse is new Traverse_More_Func (Process, Process_Itypes);
Discard : Traverse_Final_Result;
pragma Warnings (Off, Discard);
begin
generic
with function Process (N : Node_Id) return Traverse_Result is <>;
+ Process_Itypes : Boolean := False;
function Traverse_More_Func (Node : Node_Id) return Traverse_Final_Result;
-- This is a version of Atree.Traverse_Func that not only traverses
-- syntactic children of nodes, but also semantic children which are
-- logically children of the node. This concerns currently lists of
-- action nodes and ranges under Itypes, both inserted by the compiler.
+ -- Itypes are only traversed when Process_Itypes is True.
generic
with function Process (N : Node_Id) return Traverse_Result is <>;
+ Process_Itypes : Boolean := False;
procedure Traverse_More_Proc (Node : Node_Id);
pragma Inline (Traverse_More_Proc);
-- This is the same as Traverse_More_Func except that no result is