aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/gnatlink.adb
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2011-08-04 17:18:34 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2011-08-04 17:18:34 +0200
commita54d0eb4b0cb6335ddff8b01aad449a0d31fe6fb (patch)
tree2d1450e765b433d99c8b54dc23b7f75309a9077c /gcc/ada/gnatlink.adb
parent84f405a1c1900c72c8ea496ae68e101539227de4 (diff)
downloadgcc-a54d0eb4b0cb6335ddff8b01aad449a0d31fe6fb.zip
gcc-a54d0eb4b0cb6335ddff8b01aad449a0d31fe6fb.tar.gz
gcc-a54d0eb4b0cb6335ddff8b01aad449a0d31fe6fb.tar.bz2
[multiple changes]
2011-08-04 Robert Dewar <dewar@adacore.com> * sem_ch3.adb, make.adb, a-cohata.ads, sem_prag.adb, makeutl.adb, lib-xref-alfa.adb: Minor reformatting. 2011-08-04 Marc Sango <sango@adacore.com> * sem_ch12.adb (Analyze_Generic_Package_Declaration, Analyze_Generic_Subprogram_Declaration, Analyze_Package_Instantiation, Analyze_Subprogram_Instantiation): Check absence of generic in SPARK mode. 2011-08-04 Tristan Gingold <gingold@adacore.com> * bindgen.adb (Gen_Adainit_C): Remove. (Gen_Adafinal_C): Ditto. (Gen_Elab_Externals_C): Ditto. (Gen_Elab_Calls_C): Ditto. (Gen_Elab_Order_C): Ditto. (Gen_Elab_Defs_C): Ditto. (Gen_Finalize_Library_C): Ditto. (Gen_Finalize_Library_Defs_C): Ditto. (Gen_Main_C): Ditto. (Gen_Output_File_C): Ditto. (Gen_Restrictions_C): Ditto. (Gen_Versions_C): Ditto. (Write_Info_Ada_C): Ditto. (Gen_Object_Files_Options): Call WBI instead of Write_Info_Ada_C (Gen_Output_File): Do not force Ada_Bind_File anymore. Always call Gen_Output_File_Ada. * gnatlink.adb (Begin_Info): Now a constant. (End_Info): Ditto. (Ada_Bind_File): Remove (Process_Args): Do not handle -A/-C. Remove not Ada_Bind_File cases. * switch-b.adb (Scan_Binder_Switches): Do not handle -C. * gnatbind.adb (Gnatbind): Remove not Ada_Bind_File cases. * opt.ads (Ada_Bind_File): Remove. 2011-08-04 Thomas Quinot <quinot@adacore.com> * projects.texi: Document target-specific directory in default project path for gnatmake. 2011-08-04 Thomas Quinot <quinot@adacore.com> * gnatls.adb, prj-env.adb: Add $prefix/share/gpr to default project path in all cases . From-SVN: r177395
Diffstat (limited to 'gcc/ada/gnatlink.adb')
-rw-r--r--gcc/ada/gnatlink.adb101
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