summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>2008-11-07 10:46:18 +0000
committerebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>2008-11-07 10:46:18 +0000
commit814231e55a8e16da580ca2aec5f6675ed2d70ecc (patch)
treed9fefbd5cf8fd8e9e324b96d58d792f547ef67a1
parenta5ff84326b1ad918af1b84791991cfa1a90bd705 (diff)
downloadgcc-814231e55a8e16da580ca2aec5f6675ed2d70ecc.tar.gz
PR ada/34289
* lib.ads: (Enable_Switch_Storing): Declare. * lib.adb: (Enable_Switch_Storing): New procedure. * switch-c.adb (Scan_Front_End_Switches): Add support for -gnatea. * make.adb: (Compile_Sources.Compile): Add -gnatea as first option. (Display): Never display -gnatea * gcc-interface/lang-specs.h: If -gnatea is present, pass -gnatez. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@141673 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ada/ChangeLog11
-rw-r--r--gcc/ada/gcc-interface/lang-specs.h3
-rw-r--r--gcc/ada/lib.adb15
-rw-r--r--gcc/ada/lib.ads8
-rw-r--r--gcc/ada/make.adb11
-rw-r--r--gcc/ada/switch-c.adb5
6 files changed, 47 insertions, 6 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 8dadc3dfe9e..8c340c1102f 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,14 @@
+2008-11-07 Bechir Zalila <bechir.zalila@gmail.com>
+ Eric Botcazou <ebotcazou@adacore.com>
+
+ PR ada/34289
+ * lib.ads: (Enable_Switch_Storing): Declare.
+ * lib.adb: (Enable_Switch_Storing): New procedure.
+ * switch-c.adb (Scan_Front_End_Switches): Add support for -gnatea.
+ * make.adb: (Compile_Sources.Compile): Add -gnatea as first option.
+ (Display): Never display -gnatea
+ * gcc-interface/lang-specs.h: If -gnatea is present, pass -gnatez.
+
2008-11-07 Thomas Quinot <quinot@adacore.com>
* gcc-interface/trans.c (Attribute_to_gnu, case Attr_Length): Check
diff --git a/gcc/ada/gcc-interface/lang-specs.h b/gcc/ada/gcc-interface/lang-specs.h
index 65326d4c5b2..8e839a3453d 100644
--- a/gcc/ada/gcc-interface/lang-specs.h
+++ b/gcc/ada/gcc-interface/lang-specs.h
@@ -35,7 +35,8 @@
gnat1 %{I*} %{k8:-gnatk8} %{Wall:-gnatwa} %{w:-gnatws} %{!Q:-quiet}\
%{nostdinc*} %{nostdlib*}\
-dumpbase %{.adb:%b.adb}%{.ads:%b.ads}%{!.adb:%{!.ads:%b.ada}}\
- %{O*} %{W*} %{w} %{p} %{pg:-p} %{a} %{f*} %{d*} %{g*&m*} "
+ %{O*} %{W*} %{w} %{p} %{pg:-p} %{a} %{f*} %{d*}\
+ %{gnatea:-gnatez} %{g*&m*} "
#if defined(TARGET_VXWORKS_RTP)
"%{fRTS=rtp:-mrtp} "
#endif
diff --git a/gcc/ada/lib.adb b/gcc/ada/lib.adb
index dd0e24552bf..5271a4573b2 100644
--- a/gcc/ada/lib.adb
+++ b/gcc/ada/lib.adb
@@ -49,7 +49,7 @@ with Uname; use Uname;
package body Lib is
Switch_Storing_Enabled : Boolean := True;
- -- Set to False by Disable_Switch_Storing
+ -- Controlled by Enable_Switch_Storing/Disable_Switch_Storing
-----------------------
-- Local Subprograms --
@@ -433,6 +433,19 @@ package body Lib is
return Compilation_Switches.Last;
end Compilation_Switches_Last;
+ ---------------------------
+ -- Enable_Switch_Storing --
+ ---------------------------
+
+ procedure Enable_Switch_Storing is
+ begin
+ Switch_Storing_Enabled := True;
+ end Enable_Switch_Storing;
+
+ ----------------------------
+ -- Disable_Switch_Storing --
+ ----------------------------
+
procedure Disable_Switch_Storing is
begin
Switch_Storing_Enabled := False;
diff --git a/gcc/ada/lib.ads b/gcc/ada/lib.ads
index 672396e52b0..0b2eefb7537 100644
--- a/gcc/ada/lib.ads
+++ b/gcc/ada/lib.ads
@@ -562,9 +562,15 @@ package Lib is
-- which may influence the generated output file(s). Switch is the text of
-- the switch to store (except that -fRTS gets changed back to --RTS).
+ procedure Enable_Switch_Storing;
+ -- Enable registration of switches by Store_Compilation_Switch. Used to
+ -- avoid registering switches added automatically by the gcc driver at the
+ -- beginning of the command line.
+
procedure Disable_Switch_Storing;
-- Disable registration of switches by Store_Compilation_Switch. Used to
- -- avoid registering switches added automatically by the gcc driver.
+ -- avoid registering switches added automatically by the gcc driver at the
+ -- end of the command line.
procedure Store_Linker_Option_String (S : String_Id);
-- This procedure is called to register the string from a pragma
diff --git a/gcc/ada/make.adb b/gcc/ada/make.adb
index 20813c07e49..f79cbe5f0e8 100644
--- a/gcc/ada/make.adb
+++ b/gcc/ada/make.adb
@@ -2947,7 +2947,7 @@ package body Make is
Source_Index : Int;
Args : Argument_List) return Process_Id
is
- Comp_Args : Argument_List (Args'First .. Args'Last + 9);
+ Comp_Args : Argument_List (Args'First .. Args'Last + 10);
Comp_Next : Integer := Args'First;
Comp_Last : Integer;
Arg_Index : Integer;
@@ -3004,6 +3004,9 @@ package body Make is
end if;
end loop;
+ Comp_Args (Comp_Next) := new String'("-gnatea");
+ Comp_Next := Comp_Next + 1;
+
Comp_Args (Comp_Next) := Comp_Flag;
Comp_Next := Comp_Next + 1;
@@ -4109,9 +4112,11 @@ package body Make is
for J in Args'Range loop
- -- Never display -gnatez
+ -- Never display -gnatea nor -gnatez
- if Args (J).all /= "-gnatez" then
+ if Args (J).all /= "-gnatea" and then
+ Args (J).all /= "-gnatez"
+ then
-- Do not display the mapping file argument automatically
-- created when using a project file.
diff --git a/gcc/ada/switch-c.adb b/gcc/ada/switch-c.adb
index 98f70f9912a..0da8f6671f2 100644
--- a/gcc/ada/switch-c.adb
+++ b/gcc/ada/switch-c.adb
@@ -301,6 +301,11 @@ package body Switch.C is
case Switch_Chars (Ptr) is
+ when 'a' =>
+ Store_Switch := False;
+ Enable_Switch_Storing;
+ Ptr := Ptr + 1;
+
-- -gnatec (configuration pragmas)
when 'c' =>