Commit e00ee732 by Ed Schonberg Committed by Pierre-Marie de Rodat

[Ada] Unnesting: handle the semantic of Procedure_To_Call field

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

gcc/ada/

	* exp_unst.adb (Visit_Node): Handle the semantic Procedure_To_Call
	field in relevant nodes: Allocate, Free, and return statements.

From-SVN: r260947
parent 392a7e19
2018-05-30 Ed Schonberg <schonberg@adacore.com>
* exp_unst.adb (Visit_Node): Handle the semantic Procedure_To_Call
field in relevant nodes: Allocate, Free, and return statements.
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.
......
......@@ -715,6 +715,26 @@ package body Exp_Unst is
((N, Current_Subprogram, Entity (At_End_Proc (N))));
end if;
-- Similarly, the following constructs include a semantic
-- attribute Procedure_To_Call that must be handled like
-- other calls.
when N_Allocator
| N_Free_Statement
| N_Extended_Return_Statement
| N_Simple_Return_Statement
=>
declare
Proc : constant Entity_Id := Procedure_To_Call (N);
begin
if Present (Proc)
and then Scope_Within (Proc, Subp)
and then not Is_Imported (Proc)
then
Append_Unique_Call ((N, Current_Subprogram, Proc));
end if;
end;
-- A 'Access reference is a (potential) call.
-- Other attributes require special handling.
......
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