diff options
Diffstat (limited to 'gcc/ada/lib-writ.adb')
-rw-r--r-- | gcc/ada/lib-writ.adb | 39 |
1 files changed, 25 insertions, 14 deletions
diff --git a/gcc/ada/lib-writ.adb b/gcc/ada/lib-writ.adb index e792565..b65892a 100644 --- a/gcc/ada/lib-writ.adb +++ b/gcc/ada/lib-writ.adb @@ -747,16 +747,16 @@ package body Lib.Writ is ---------------------- procedure Write_With_Lines is - With_Table : Unit_Ref_Table (1 .. Pos (Last_Unit - Units.First + 1)); - Num_Withs : Int := 0; - Unum : Unit_Number_Type; - Cunit : Node_Id; - Uname : Unit_Name_Type; - Fname : File_Name_Type; Pname : constant Unit_Name_Type := Get_Parent_Spec_Name (Unit_Name (Main_Unit)); Body_Fname : File_Name_Type; Body_Index : Nat; + Cunit : Node_Id; + Fname : File_Name_Type; + Num_Withs : Int := 0; + Unum : Unit_Number_Type; + Uname : Unit_Name_Type; + With_Table : Unit_Ref_Table (1 .. Pos (Last_Unit - Units.First + 1)); procedure Write_With_File_Names (Nam : in out File_Name_Type; @@ -814,10 +814,18 @@ package body Lib.Writ is Sort (With_Table (1 .. Num_Withs)); for J in 1 .. Num_Withs loop - Unum := With_Table (J); - Cunit := Units.Table (Unum).Cunit; - Uname := Units.Table (Unum).Unit_Name; - Fname := Units.Table (Unum).Unit_File_Name; + Unum := With_Table (J); + + -- Do not generate a with line for an ignored Ghost unit because + -- the unit does not have an ALI file. + + if Is_Ignored_Ghost_Entity (Cunit_Entity (Unum)) then + goto Next_With_Line; + end if; + + Cunit := Units.Table (Unum).Cunit; + Uname := Units.Table (Unum).Unit_Name; + Fname := Units.Table (Unum).Unit_File_Name; if Implicit_With (Unum) = Yes then Write_Info_Initiate ('Z'); @@ -914,6 +922,9 @@ package body Lib.Writ is end if; Write_Info_EOL; + + <<Next_With_Line>> + null; end loop; -- Finally generate the special lines for cases of Restriction_Set @@ -932,7 +943,7 @@ package body Lib.Writ is for U in 0 .. Last_Unit loop if Unit_Name (U) = Unam then - goto Continue; + goto Next_Restriction_Set; end if; end loop; @@ -943,7 +954,7 @@ package body Lib.Writ is Write_Info_Name (Unam); Write_Info_EOL; - <<Continue>> + <<Next_Restriction_Set>> null; end loop; end; @@ -996,8 +1007,8 @@ package body Lib.Writ is end if; end if; - -- Otherwise acquire compilation arguments and prepare to write - -- out a new ali file. + -- Otherwise acquire compilation arguments and prepare to write out a + -- new ali file. Create_Output_Library_Info; |