summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2015-11-25 15:10:52 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2015-11-25 15:10:52 +0000
commit559323109a4199620e04a1efc0578036554e4e23 (patch)
treee779966df341a0b8d579c693dc4abe59e319a575
parentdecb95fccf1417e1dfc71bd515b5be472b1b4145 (diff)
downloadgcc-559323109a4199620e04a1efc0578036554e4e23.tar.gz
2015-11-25 Vincent Celier <celier@adacore.com>
* gnatcmd.adb: When <target>-gnat is called with switch -P and a GPR tool is invoked, invoke the GPR tool with switch --target=<target>. 2015-11-25 Hristian Kirtchev <kirtchev@adacore.com> * opt.adb, bcheck.adb: Minor reformatting. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@230876 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ada/ChangeLog10
-rw-r--r--gcc/ada/bcheck.adb9
-rw-r--r--gcc/ada/gnatcmd.adb61
-rw-r--r--gcc/ada/opt.adb12
4 files changed, 61 insertions, 31 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index b7be5a5202b..ea9c5e9c8ac 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,13 @@
+2015-11-25 Vincent Celier <celier@adacore.com>
+
+ * gnatcmd.adb: When <target>-gnat is called with switch -P
+ and a GPR tool is invoked, invoke the GPR tool with switch
+ --target=<target>.
+
+2015-11-25 Hristian Kirtchev <kirtchev@adacore.com>
+
+ * opt.adb, bcheck.adb: Minor reformatting.
+
2015-11-25 Jerome Lambourg <lambourg@adacore.com>
* init.c: Enable the signal trampoline on x86_64-vx7
diff --git a/gcc/ada/bcheck.adb b/gcc/ada/bcheck.adb
index fcfb2f489bf..66341b44317 100644
--- a/gcc/ada/bcheck.adb
+++ b/gcc/ada/bcheck.adb
@@ -1176,16 +1176,17 @@ package body Bcheck is
begin
Check_Mechanism : for A1 in ALIs.First + 1 .. ALIs.Last loop
if (ALIs.Table (A1).Zero_Cost_Exceptions /=
- ALIs.Table (ALIs.First).Zero_Cost_Exceptions)
+ ALIs.Table (ALIs.First).Zero_Cost_Exceptions)
or else
(ALIs.Table (A1).Frontend_Exceptions /=
- ALIs.Table (ALIs.First).Frontend_Exceptions)
+ ALIs.Table (ALIs.First).Frontend_Exceptions)
then
Error_Msg_File_1 := ALIs.Table (A1).Sfile;
Error_Msg_File_2 := ALIs.Table (ALIs.First).Sfile;
- Consistency_Error_Msg ("{ and { compiled with different "
- & "exception handling mechanisms");
+ Consistency_Error_Msg
+ ("{ and { compiled with different exception handling "
+ & "mechanisms");
end if;
end loop Check_Mechanism;
end Check_Consistent_Exception_Handling;
diff --git a/gcc/ada/gnatcmd.adb b/gcc/ada/gnatcmd.adb
index df648319c5f..451f2021387 100644
--- a/gcc/ada/gnatcmd.adb
+++ b/gcc/ada/gnatcmd.adb
@@ -58,13 +58,8 @@ with GNAT.OS_Lib; use GNAT.OS_Lib;
procedure GNATCmd is
Gprbuild : constant String := "gprbuild";
- Gnatmake : constant String := "gnatmake";
-
- Gprclean : constant String := "gprclean";
- Gnatclean : constant String := "gnatclean";
-
+ Gprclean : constant String := "gprclean";
Gprname : constant String := "gprname";
- Gnatname : constant String := "gnatname";
Normal_Exit : exception;
-- Raise this exception for normal program termination
@@ -1170,8 +1165,9 @@ begin
end loop;
declare
- Program : String_Access;
- Exec_Path : String_Access;
+ Program : String_Access;
+ Exec_Path : String_Access;
+ Get_Target : Boolean := False;
begin
if The_Command = Stack then
@@ -1188,9 +1184,10 @@ begin
-- instead of gnatmake/gnatclean.
-- Ditto for gnatname -> gprname.
- if Program.all = Gnatmake
- or else Program.all = Gnatclean
- or else Program.all = Gnatname
+ if The_Command = Make
+ or else The_Command = Compile
+ or else The_Command = Clean
+ or else The_Command = Name
then
declare
Project_File_Used : Boolean := False;
@@ -1208,19 +1205,37 @@ begin
end loop;
if Project_File_Used then
- if Program.all = Gnatmake
- and then Locate_Exec_On_Path (Gprbuild) /= null
- then
- Program := new String'(Gprbuild);
- elsif Program.all = Gnatclean
- and then Locate_Exec_On_Path (Gprclean) /= null
- then
- Program := new String'(Gprclean);
+ case The_Command is
+ when Make | Compile =>
+ if Locate_Exec_On_Path (Gprbuild) /= null then
+ Program := new String'(Gprbuild);
+ Get_Target := True;
+ end if;
- elsif Program.all = Gnatname
- and then Locate_Exec_On_Path (Gprname) /= null
- then
- Program := new String'(Gprname);
+ when Clean =>
+ if Locate_Exec_On_Path (Gprclean) /= null then
+ Program := new String'(Gprclean);
+ Get_Target := True;
+ end if;
+
+ when Name =>
+ if Locate_Exec_On_Path (Gprname) /= null then
+ Program := new String'(Gprname);
+ Get_Target := True;
+ end if;
+
+ when others =>
+ null;
+ end case;
+
+ if Get_Target then
+ Find_Program_Name;
+
+ if Name_Len > 5 then
+ First_Switches.Append
+ (new String'
+ ("--target=" & Name_Buffer (1 .. Name_Len - 5)));
+ end if;
end if;
end if;
end;
diff --git a/gcc/ada/opt.adb b/gcc/ada/opt.adb
index 213b6f4bc1b..f1ce4a4afa3 100644
--- a/gcc/ada/opt.adb
+++ b/gcc/ada/opt.adb
@@ -44,8 +44,10 @@ package body Opt is
function Back_End_Exceptions return Boolean is
begin
- return Exception_Mechanism = Back_End_SJLJ
- or else Exception_Mechanism = Back_End_ZCX;
+ return
+ Exception_Mechanism = Back_End_SJLJ
+ or else
+ Exception_Mechanism = Back_End_ZCX;
end Back_End_Exceptions;
-------------------------
@@ -63,8 +65,10 @@ package body Opt is
function SJLJ_Exceptions return Boolean is
begin
- return Exception_Mechanism = Back_End_SJLJ
- or else Exception_Mechanism = Front_End_SJLJ;
+ return
+ Exception_Mechanism = Back_End_SJLJ
+ or else
+ Exception_Mechanism = Front_End_SJLJ;
end SJLJ_Exceptions;
--------------------