Commit 861f090e by Ed Schonberg Committed by Arnaud Charlet

sem_ch12.adb (Analyze_Package_Instantiation): Inline_Now is false if the current…

sem_ch12.adb (Analyze_Package_Instantiation): Inline_Now is false if the current instance is nested within another instance...

2006-02-17  Ed Schonberg  <schonberg@adacore.com>

	* sem_ch12.adb (Analyze_Package_Instantiation): Inline_Now is false if
	the current instance is nested within another instance in a child unit.

From-SVN: r111192
parent 9af38f0c
...@@ -2710,17 +2710,25 @@ package body Sem_Ch12 is ...@@ -2710,17 +2710,25 @@ package body Sem_Ch12 is
end if; end if;
-- If the current scope is itself an instance within a child -- If the current scope is itself an instance within a child
-- unit, and that unit itself is not an instance, it is -- unit,there will be duplications in the scope stack, and the
-- duplicated in the scope stack, and the unstacking mechanism -- unstacking mechanism in Inline_Instance_Body will fail.
-- in Inline_Instance_Body will fail. This loses some rare -- This loses some rare cases of optimization, and might be
-- cases of optimization, and might be improved some day ???? -- improved some day, if we can find a proper abstraction for
-- "the complete compilation context" that can be saved and
if Is_Generic_Instance (Current_Scope) -- restored ???
and then Is_Child_Unit (Scope (Current_Scope))
and then not Is_Generic_Instance (Scope (Current_Scope)) if Is_Generic_Instance (Current_Scope) then
declare
Curr_Unit : constant Entity_Id :=
Cunit_Entity (Current_Sem_Unit);
begin
if Curr_Unit /= Current_Scope
and then Is_Child_Unit (Curr_Unit)
then then
Inline_Now := False; Inline_Now := False;
end if; end if;
end;
end if;
end if; end if;
Needs_Body := Needs_Body :=
......
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