+2019-08-14 Eric Botcazou <ebotcazou@adacore.com>
+
+ * inline.ads (Pending_Descriptor): Delete.
+ * inline.adb (Initialize): Do not initialize it.
+ * sem_ch12.adb (Delay_Descriptors): Delete.
+ (Analyze_Package_Instantiation): Call
+ Set_Delay_Subprogram_Descriptors instead of Delay_Descriptors
+ throughout.
+
2019-08-14 Bob Duff <duff@adacore.com>
* exp_aggr.adb (Init_Hidden_Discriminants): Avoid processing the
Table_Increment => Alloc.Pending_Instantiations_Increment,
Table_Name => "Pending_Instantiations");
- -- The following table records subprograms and packages for which
- -- generation of subprogram descriptors must be delayed.
-
- package Pending_Descriptor is new Table.Table (
- Table_Component_Type => Entity_Id,
- Table_Index_Type => Int,
- Table_Low_Bound => 0,
- Table_Initial => Alloc.Pending_Instantiations_Initial,
- Table_Increment => Alloc.Pending_Instantiations_Increment,
- Table_Name => "Pending_Descriptor");
-
- -- The following should be initialized in an init call in Frontend, we
- -- have thoughts of making the frontend reusable in future ???
-
-----------------
-- Subprograms --
-----------------
procedure Analyze_Package_Instantiation (N : Node_Id) is
Has_Inline_Always : Boolean := False;
- procedure Delay_Descriptors (E : Entity_Id);
- -- Delay generation of subprogram descriptors for given entity
-
function Might_Inline_Subp (Gen_Unit : Entity_Id) return Boolean;
-- If inlining is active and the generic contains inlined subprograms,
-- we instantiate the body. This may cause superfluous instantiations,
-- but it is simpler than detecting the need for the body at the point
-- of inlining, when the context of the instance is not available.
- -----------------------
- -- Delay_Descriptors --
- -----------------------
-
- procedure Delay_Descriptors (E : Entity_Id) is
- begin
- if not Delay_Subprogram_Descriptors (E) then
- Set_Delay_Subprogram_Descriptors (E);
- Pending_Descriptor.Append (E);
- end if;
- end Delay_Descriptors;
-
-----------------------
-- Might_Inline_Subp --
-----------------------
if Ekind (Enclosing_Master) = E_Package then
if Is_Compilation_Unit (Enclosing_Master) then
if In_Package_Body (Enclosing_Master) then
- Delay_Descriptors
+ Set_Delay_Subprogram_Descriptors
(Body_Entity (Enclosing_Master));
else
- Delay_Descriptors
+ Set_Delay_Subprogram_Descriptors
(Enclosing_Master);
end if;
end loop;
if Is_Subprogram (Enclosing_Master) then
- Delay_Descriptors (Enclosing_Master);
+ Set_Delay_Subprogram_Descriptors (Enclosing_Master);
elsif Is_Task_Type (Enclosing_Master) then
declare
(Enclosing_Master);
begin
if Present (TBP) then
- Delay_Descriptors (TBP);
+ Set_Delay_Subprogram_Descriptors (TBP);
Set_Delay_Cleanups (TBP);
end if;
end;