summaryrefslogtreecommitdiff
path: root/gcc/ada/inline.adb
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/ada/inline.adb')
-rw-r--r--gcc/ada/inline.adb13
1 files changed, 9 insertions, 4 deletions
diff --git a/gcc/ada/inline.adb b/gcc/ada/inline.adb
index 84a08ac659e..09ba57ca678 100644
--- a/gcc/ada/inline.adb
+++ b/gcc/ada/inline.adb
@@ -479,12 +479,12 @@ package body Inline is
begin
Analyzing_Inlined_Bodies := False;
- if Errors_Detected = 0 then
+ if Serious_Errors_Detected = 0 then
New_Scope (Standard_Standard);
J := 0;
while J <= Inlined_Bodies.Last
- and then Errors_Detected = 0
+ and then Serious_Errors_Detected = 0
loop
Pack := Inlined_Bodies.Table (J);
@@ -503,9 +503,14 @@ package body Inline is
Comp_Unit := Parent (Comp_Unit);
end loop;
+ -- Load the body, unless it the main unit, or is an instance
+ -- whose body has already been analyzed.
+
if Present (Comp_Unit)
and then Comp_Unit /= Cunit (Main_Unit)
and then Body_Required (Comp_Unit)
+ and then (Nkind (Unit (Comp_Unit)) /= N_Package_Declaration
+ or else No (Corresponding_Body (Unit (Comp_Unit))))
then
declare
Bname : constant Unit_Name_Type :=
@@ -757,7 +762,7 @@ package body Inline is
Info : Pending_Body_Info;
begin
- if Errors_Detected = 0 then
+ if Serious_Errors_Detected = 0 then
Expander_Active := (Operating_Mode = Opt.Generate_Code);
New_Scope (Standard_Standard);
@@ -774,7 +779,7 @@ package body Inline is
J := 0;
while J <= Pending_Instantiations.Last
- and then Errors_Detected = 0
+ and then Serious_Errors_Detected = 0
loop
Info := Pending_Instantiations.Table (J);