Instantiating => True);
begin
- Generic_Renamings.Set_Last (0);
+ Generic_Renamings.Set_Last (-1);
Generic_Renamings_HTable.Reset;
Instantiation_Node := N;
-- inherited from formal packages of parent units, and these are
-- constructed when the parents are installed.
- Generic_Renamings.Set_Last (0);
+ Generic_Renamings.Set_Last (-1);
Generic_Renamings_HTable.Reset;
-- Except for an abbreviated instance created to check a formal package,
-- Initialize renamings map, for error checking
- Generic_Renamings.Set_Last (0);
+ Generic_Renamings.Set_Last (-1);
Generic_Renamings_HTable.Reset;
Create_Instantiation_Source (N, Gen_Unit, S_Adjustment);
Restore_Hidden_Primitives (Vis_Prims_List);
Restore_Env;
Env_Installed := False;
- Generic_Renamings.Set_Last (0);
+ Generic_Renamings.Set_Last (-1);
Generic_Renamings_HTable.Reset;
end if;
procedure Set_Instance_Of (A : Entity_Id; B : Entity_Id) is
begin
- Generic_Renamings.Table (Generic_Renamings.Last) := (A, B, Assoc_Null);
+ Generic_Renamings.Append ((A, B, Assoc_Null));
Generic_Renamings_HTable.Set (Generic_Renamings.Last);
- Generic_Renamings.Increment_Last;
end Set_Instance_Of;
--------------------
(Assoc_Ptr (Index));
Result_Pair : Binding_Pair renames Result (Index);
begin
- -- If we have called Increment_Last but have not yet
- -- initialized the new last element of the table, then
- -- that last element might be invalid. Saving and
- -- restoring (especially restoring, it turns out) invalid
- -- values can result in exceptions if predicate checking
- -- is enabled, so replace invalid values with Empty.
-
- if Indexed_Assoc.Gen_Id'Valid then
- Result_Pair.Formal_Id := Indexed_Assoc.Gen_Id;
- else
- pragma Assert (Index = Result'Last);
- Result_Pair.Formal_Id := Empty;
- end if;
-
- if Indexed_Assoc.Act_Id'Valid then
- Result_Pair.Actual_Id := Indexed_Assoc.Act_Id;
- else
- pragma Assert (Index = Result'Last);
- Result_Pair.Actual_Id := Empty;
- end if;
+ Result_Pair.Formal_Id := Indexed_Assoc.Gen_Id;
+ Result_Pair.Actual_Id := Indexed_Assoc.Act_Id;
end;
end loop;
Generic_Renamings.Init;
- Generic_Renamings.Set_Last (-1);
Generic_Renamings_HTable.Reset;
end return;
end Save_And_Reset;
procedure Restore (Saved : Context) is
begin
Generic_Renamings.Init;
- Generic_Renamings.Set_Last (0);
Generic_Renamings_HTable.Reset;
- Generic_Renamings.Increment_Last;
for Pair of Saved loop
Set_Instance_Of (Pair.Formal_Id, Pair.Actual_Id);
end loop;
- Generic_Renamings.Decrement_Last;
end Restore;
end Instance_Context;