+2018-07-16 Ed Schonberg <schonberg@adacore.com>
+
+ * exp_unst.adb (Visit_Node): Handle the semantic of Storage_Pool field
+ in relevant nodes: Allocate, Free, and return statements.
+
2018-07-16 Ed Schonberg <schonberg@adacore.com>
* sem_ch12.adb (Analyze_Package_Instantiation): Handle properly an
-- Similarly, the following constructs include a semantic
-- attribute Procedure_To_Call that must be handled like
- -- other calls.
+ -- other calls. Likewise for attribute Storage_Pool.
when N_Allocator
| N_Extended_Return_Statement
| N_Simple_Return_Statement
=>
declare
+ Pool : constant Entity_Id := Storage_Pool (N);
Proc : constant Entity_Id := Procedure_To_Call (N);
+
begin
if Present (Proc)
and then Scope_Within (Proc, Subp)
then
Append_Unique_Call ((N, Current_Subprogram, Proc));
end if;
+
+ if Present (Pool)
+ and then not Is_Library_Level_Entity (Pool)
+ and then Scope_Within_Or_Same (Scope (Pool), Subp)
+ then
+ Caller := Current_Subprogram;
+ Callee := Enclosing_Subprogram (Pool);
+
+ if Callee /= Caller then
+ Note_Uplevel_Ref (Pool, Empty, Caller, Callee);
+ end if;
+ end if;
end;
-- For an allocator with a qualified expression, check type