+2018-06-11 Ed Schonberg <schonberg@adacore.com>
+
+ * exp_unst.adb (Search_Subprograms): Handle explicitly stubs at the top
+ level of a compilation unit, becuase they may contain nested
+ subprograms that need an activation record.
+
2018-06-11 Arnaud Charlet <charlet@adacore.com>
* Makefile.rtl: Compile Ada files with $(ADAC) instead of $(CC).
return Skip;
end if;
- -- Otherwise record an uplevel reference
+ -- Otherwise record an uplevel reference in a local
+ -- identifier.
when others =>
if Nkind (N) in N_Has_Entity
New_Occurrence_Of (Ent, Loc),
Attribute_Name => Name_Address));
+ -- or else 'Access for unconstrained
Insert_After (Ins, Asn);
-- Analyze the assignment statement. We do
-- Tree visitor that search for outer level procedures with nested
-- subprograms and invokes Unnest_Subprogram()
+ ---------------
+ -- Do_Search --
+ ---------------
+
+ procedure Do_Search is new Traverse_Proc (Search_Subprograms);
+ -- Subtree visitor instantiation
+
------------------------
-- Search_Subprograms --
------------------------
end;
end if;
- return OK;
- end Search_Subprograms;
+ -- The proper body of a stub may contain nested subprograms,
+ -- and therefore must be visited explicitly. Nested stubs are
+ -- examined recursively in Visit_Node.
- ---------------
- -- Do_Search --
- ---------------
+ if Nkind (N) in N_Body_Stub then
+ Do_Search (Library_Unit (N));
+ end if;
- procedure Do_Search is new Traverse_Proc (Search_Subprograms);
- -- Subtree visitor instantiation
+ return OK;
+ end Search_Subprograms;
-- Start of processing for Unnest_Subprograms