Commit 392a7e19 by Ed Schonberg Committed by Pierre-Marie de Rodat

[Ada] Unnesting: skip unanalyzed Component_Assocation

2018-05-30  Ed Schonberg  <schonberg@adacore.com>

gcc/ada/

	* exp_unst.adb (Visit_Node): Do not traverse a Component_Association
	that has not been analyzed, as will be the case for a nested aggregate
	that is expanded into individual assignments.

From-SVN: r260946
parent 656d1fba
2018-05-30 Ed Schonberg <schonberg@adacore.com>
* exp_unst.adb (Visit_Node): Do not traverse a Component_Association
that has not been analyzed, as will be the case for a nested aggregate
that is expanded into individual assignments.
2018-05-30 Justin Squirek <squirek@adacore.com> 2018-05-30 Justin Squirek <squirek@adacore.com>
* aspects.adb, aspects.ads: Register new aspect. * aspects.adb, aspects.ads: Register new aspect.
......
...@@ -775,6 +775,16 @@ package body Exp_Unst is ...@@ -775,6 +775,16 @@ package body Exp_Unst is
end case; end case;
end; end;
-- Component associations in aggregates are either static
-- or else the aggregate will be expanded into assignments,
-- in which case the expression is analyzed later and provides
-- no relevant code generation.
when N_Component_Association =>
if No (Etype (Expression (N))) then
return Skip;
end if;
-- Indexed references can be uplevel if the type isn't static -- Indexed references can be uplevel if the type isn't static
-- and if the lower bound (or an inner bound for a multi- -- and if the lower bound (or an inner bound for a multi-
-- dimensional array) is uplevel. -- dimensional array) is uplevel.
...@@ -1865,8 +1875,7 @@ package body Exp_Unst is ...@@ -1865,8 +1875,7 @@ package body Exp_Unst is
begin begin
if Present (STT.ARECnF) if Present (STT.ARECnF)
and then Nkind (CTJ.N) /= N_Attribute_Reference and then Nkind (CTJ.N) in N_Subprogram_Call
and then Nkind (CTJ.N) /= N_Handled_Sequence_Of_Statements
then then
-- CTJ.N is a call to a subprogram which may require a pointer -- CTJ.N is a call to a subprogram which may require a pointer
-- to an activation record. The subprogram containing the call -- to an activation record. The subprogram containing the call
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment