summaryrefslogtreecommitdiff
path: root/gcc/ada/switch-c.adb
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2013-04-12 12:44:46 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2013-04-12 12:44:46 +0000
commit5462ac01ae2035b20215e90ae6a4f2274f9eaa14 (patch)
tree69a350ea09318ce3eb5442786f940b6810e4098e /gcc/ada/switch-c.adb
parent533c15bc0353f4778c022cafe6dfc3fb810fba3c (diff)
downloadgcc-5462ac01ae2035b20215e90ae6a4f2274f9eaa14.tar.gz
2013-04-12 Robert Dewar <dewar@adacore.com>
* gnat1drv.adb (Gnat1drv): Test Target_Dependent_Info_Write_Name. * opt.ads (Target_Dependent_Info_Read): Add _Name, now an access type (Target_Dependent_Info_Write): Add _Name, now an access type. * set_targ.adb (Write_Target_Dependent_Values): Use name from -gnatet switch stored in Target_Dependent_Info_Write_Name (Read_Target_Dependent_Values): Use name from -gnateT switch stored in Target_Dependent_Info_Read_Name. * switch-c.adb: New form of -gnatet and -gnateT switches. * usage.adb: New form of -gnatet and -gnateT switches with file name. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@197898 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/switch-c.adb')
-rw-r--r--gcc/ada/switch-c.adb35
1 files changed, 32 insertions, 3 deletions
diff --git a/gcc/ada/switch-c.adb b/gcc/ada/switch-c.adb
index 4ebecc9430f..9102507230a 100644
--- a/gcc/ada/switch-c.adb
+++ b/gcc/ada/switch-c.adb
@@ -597,7 +597,6 @@ package body Switch.C is
if Ptr >= Max or else Switch_Chars (Ptr) /= '=' then
Bad_Switch ("-gnateO");
-
else
Object_Path_File_Name :=
new String'(Switch_Chars (Ptr + 1 .. Max));
@@ -651,9 +650,25 @@ package body Switch.C is
-- -gnatet (write target dependent information)
when 't' =>
- Target_Dependent_Info_Write := True;
+ if not First_Switch then
+ Osint.Fail
+ ("-gnatet must be first if combined with "
+ & "other switches");
+ end if;
+
+ -- Check for '='
+
Ptr := Ptr + 1;
+ if Ptr >= Max or else Switch_Chars (Ptr) /= '=' then
+ Bad_Switch ("-gnatet");
+ else
+ Target_Dependent_Info_Write_Name :=
+ new String'(Switch_Chars (Ptr + 1 .. Max));
+ end if;
+
+ return;
+
-- -gnateT (read target dependent information)
when 'T' =>
@@ -663,9 +678,23 @@ package body Switch.C is
& "other switches");
end if;
- Target_Dependent_Info_Read := True;
+ -- Check for '='
+
Ptr := Ptr + 1;
+ if Ptr >= Max or else Switch_Chars (Ptr) /= '=' then
+ Bad_Switch ("-gnateT");
+ else
+ -- This parameter was stored by Set_Targ earlier
+
+ pragma Assert
+ (Target_Dependent_Info_Read_Name.all =
+ Switch_Chars (Ptr + 1 .. Max));
+ null;
+ end if;
+
+ return;
+
-- -gnateV (validity checks on parameters)
when 'V' =>