From 5462ac01ae2035b20215e90ae6a4f2274f9eaa14 Mon Sep 17 00:00:00 2001 From: charlet Date: Fri, 12 Apr 2013 12:44:46 +0000 Subject: 2013-04-12 Robert Dewar * 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 --- gcc/ada/switch-c.adb | 35 ++++++++++++++++++++++++++++++++--- 1 file changed, 32 insertions(+), 3 deletions(-) (limited to 'gcc/ada/switch-c.adb') 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' => -- cgit v1.2.1