diff options
Diffstat (limited to 'gcc/ada/gnatlink.adb')
-rw-r--r-- | gcc/ada/gnatlink.adb | 101 |
1 files changed, 29 insertions, 72 deletions
diff --git a/gcc/ada/gnatlink.adb b/gcc/ada/gnatlink.adb index 946c7b5..7e7a10b 100644 --- a/gcc/ada/gnatlink.adb +++ b/gcc/ada/gnatlink.adb @@ -141,9 +141,8 @@ procedure Gnatlink is Read_Mode : constant String := "r" & ASCII.NUL; - Begin_Info : String := "-- BEGIN Object file/option list"; - End_Info : String := "-- END Object file/option list "; - -- Note: above lines are modified in C mode, see option processing + Begin_Info : constant String := "-- BEGIN Object file/option list"; + End_Info : constant String := "-- END Object file/option list "; Gcc_Path : String_Access; Linker_Path : String_Access; @@ -163,9 +162,6 @@ procedure Gnatlink is Verbose_Mode : Boolean := False; Very_Verbose_Mode : Boolean := False; - Ada_Bind_File : Boolean := True; - -- Set to True if bind file is generated in Ada - Standard_Gcc : Boolean := True; Compile_Bind_File : Boolean := True; @@ -413,11 +409,6 @@ procedure Gnatlink is elsif Arg'Length = 2 then case Arg (2) is - when 'A' => - Ada_Bind_File := True; - Begin_Info := "-- BEGIN Object file/option list"; - End_Info := "-- END Object file/option list "; - when 'b' => Linker_Options.Increment_Last; Linker_Options.Table (Linker_Options.Last) := @@ -448,11 +439,6 @@ procedure Gnatlink is end Get_Machine_Name; - when 'C' => - Ada_Bind_File := False; - Begin_Info := "/* BEGIN Object file/option list"; - End_Info := " END Object file/option list */"; - when 'f' => if Object_List_File_Supported then Object_List_File_Required := True; @@ -663,13 +649,11 @@ procedure Gnatlink is Next_Arg := Next_Arg + 1; end loop; - -- If Ada bind file, then compile it with warnings suppressed, because + -- Compile the bind file with warnings suppressed, because -- otherwise the with of the main program may cause junk warnings. - if Ada_Bind_File then - Binder_Options.Increment_Last; - Binder_Options.Table (Binder_Options.Last) := new String'("-gnatws"); - end if; + Binder_Options.Increment_Last; + Binder_Options.Table (Binder_Options.Last) := new String'("-gnatws"); -- If we did not get an ali file at all, and we had at least one -- linker option, then assume that was the intended ali file after @@ -937,11 +921,8 @@ procedure Gnatlink is exit when Next_Line (Nfirst .. Nlast) = End_Info; - if Ada_Bind_File then - Next_Line (Nfirst .. Nlast - 8) := - Next_Line (Nfirst + 8 .. Nlast); - Nlast := Nlast - 8; - end if; + Next_Line (Nfirst .. Nlast - 8) := Next_Line (Nfirst + 8 .. Nlast); + Nlast := Nlast - 8; -- Go to next section when switches are reached @@ -1413,11 +1394,8 @@ procedure Gnatlink is Get_Next_Line; exit when Next_Line (Nfirst .. Nlast) = End_Info; - if Ada_Bind_File then - Next_Line (Nfirst .. Nlast - 8) := - Next_Line (Nfirst + 8 .. Nlast); - Nlast := Nlast - 8; - end if; + Next_Line (Nfirst .. Nlast - 8) := Next_Line (Nfirst + 8 .. Nlast); + Nlast := Nlast - 8; end loop; end if; @@ -1611,12 +1589,10 @@ begin elsif Arg'Length > 5 and then Arg (Arg'First + 2 .. Arg'First + 5) = "RTS=" then - if Ada_Bind_File then - Binder_Options_From_ALI.Increment_Last; - Binder_Options_From_ALI.Table - (Binder_Options_From_ALI.Last) - := String_Access (Arg); - end if; + Binder_Options_From_ALI.Increment_Last; + Binder_Options_From_ALI.Table + (Binder_Options_From_ALI.Last) + := String_Access (Arg); -- Set the RTS_*_Path_Name variables, so that -- the correct directories will be set when @@ -1666,14 +1642,9 @@ begin when CLI_Target => Gcc := new String'("dotnet-gnatcompile"); when No_VM => raise Program_Error; end case; - - Ada_Bind_File := True; - Begin_Info := "-- BEGIN Object file/option list"; - End_Info := "-- END Object file/option list "; end if; - -- If the main program is in Ada it is compiled with the following - -- switches: + -- Compile the bind file with the following switches: -- -gnatA stops reading gnat.adc, since we don't know what -- pragmas would work, and we do not need it anyway. @@ -1686,22 +1657,20 @@ begin -- In addition, in CodePeer mode compile with -gnatC - if Ada_Bind_File then - Binder_Options_From_ALI.Increment_Last; - Binder_Options_From_ALI.Table (Binder_Options_From_ALI.Last) := + Binder_Options_From_ALI.Increment_Last; + Binder_Options_From_ALI.Table (Binder_Options_From_ALI.Last) := new String'("-gnatA"); - Binder_Options_From_ALI.Increment_Last; - Binder_Options_From_ALI.Table (Binder_Options_From_ALI.Last) := + Binder_Options_From_ALI.Increment_Last; + Binder_Options_From_ALI.Table (Binder_Options_From_ALI.Last) := new String'("-gnatWb"); - Binder_Options_From_ALI.Increment_Last; - Binder_Options_From_ALI.Table (Binder_Options_From_ALI.Last) := + Binder_Options_From_ALI.Increment_Last; + Binder_Options_From_ALI.Table (Binder_Options_From_ALI.Last) := new String'("-gnatiw"); - if Opt.CodePeer_Mode then - Binder_Options_From_ALI.Increment_Last; - Binder_Options_From_ALI.Table (Binder_Options_From_ALI.Last) := + if Opt.CodePeer_Mode then + Binder_Options_From_ALI.Increment_Last; + Binder_Options_From_ALI.Table (Binder_Options_From_ALI.Last) := new String'("-gnatC"); - end if; end if; -- Locate all the necessary programs and verify required files are present @@ -1814,9 +1783,7 @@ begin begin -- Set prefix - if not Ada_Bind_File then - Bind_File_Prefix := new String'("b_"); - elsif OpenVMS_On_Target then + if OpenVMS_On_Target then Bind_File_Prefix := new String'("b__"); else Bind_File_Prefix := new String'("b~"); @@ -1839,13 +1806,9 @@ begin Fname (Fname'First .. Fname'First + Fname_Len - 1); begin - if Ada_Bind_File then - Binder_Spec_Src_File := new String'(Fnam & ".ads"); - Binder_Body_Src_File := new String'(Fnam & ".adb"); - Binder_Ali_File := new String'(Fnam & ".ali"); - else - Binder_Body_Src_File := new String'(Fnam & ".c"); - end if; + Binder_Spec_Src_File := new String'(Fnam & ".ads"); + Binder_Body_Src_File := new String'(Fnam & ".adb"); + Binder_Ali_File := new String'(Fnam & ".ali"); Binder_Obj_File := new String'(Fnam & Get_Target_Object_Suffix.all); end; @@ -2272,14 +2235,8 @@ begin -- useful if debugging. if not Debug_Flag_Present then - if Binder_Ali_File /= null then - Delete (Binder_Ali_File.all & ASCII.NUL); - end if; - - if Binder_Spec_Src_File /= null then - Delete (Binder_Spec_Src_File.all & ASCII.NUL); - end if; - + Delete (Binder_Ali_File.all & ASCII.NUL); + Delete (Binder_Spec_Src_File.all & ASCII.NUL); Delete (Binder_Body_Src_File.all & ASCII.NUL); if VM_Target = No_VM then |