diff options
author | Vincent Celier <celier@adacore.com> | 2010-06-17 09:06:41 +0000 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2010-06-17 11:06:41 +0200 |
commit | 67e740fa3005211b72da34e28ec2a8a22dcc4797 (patch) | |
tree | 25c725c1b73e3d2b69447a18fb45899560dec4d2 /gcc/ada/switch-c.adb | |
parent | bce79204fbd55ec8f622979e582752e44498c76c (diff) | |
download | gcc-67e740fa3005211b72da34e28ec2a8a22dcc4797.zip gcc-67e740fa3005211b72da34e28ec2a8a22dcc4797.tar.gz gcc-67e740fa3005211b72da34e28ec2a8a22dcc4797.tar.bz2 |
back_end.adb (Scan_Compiler_Arguments): Put all arguments in new local Argument_List variable Args.
2010-06-17 Vincent Celier <celier@adacore.com>
* back_end.adb (Scan_Compiler_Arguments): Put all arguments in new
local Argument_List variable Args.
* switch-c.adb (Scan_Front_End_Switches): New Argument_List argument
Args.
(Switch_Subsequently_Cancelled): New Argument_List argument Args. Look
for subsequent switches in Args.
* switch-c.ads (Scan_Front_End_Switches): New Argument_List argument
Args.
* gcc-interface/Make-lang.in: Update dependencies.
From-SVN: r160890
Diffstat (limited to 'gcc/ada/switch-c.adb')
-rw-r--r-- | gcc/ada/switch-c.adb | 28 |
1 files changed, 10 insertions, 18 deletions
diff --git a/gcc/ada/switch-c.adb b/gcc/ada/switch-c.adb index 39bda75..09a87e0 100644 --- a/gcc/ada/switch-c.adb +++ b/gcc/ada/switch-c.adb @@ -32,9 +32,7 @@ with Validsw; use Validsw; with Sem_Warn; use Sem_Warn; with Stylesw; use Stylesw; -with Ada.Command_Line; use Ada.Command_Line; - -with System.OS_Lib; use System.OS_Lib; +with System.Strings; with System.WCh_Con; use System.WCh_Con; package body Switch.C is @@ -44,6 +42,7 @@ package body Switch.C is function Switch_Subsequently_Cancelled (C : String; + Args : Argument_List; Arg_Rank : Positive) return Boolean; -- This function is called from Scan_Front_End_Switches. It determines if -- the switch currently being scanned is followed by a switch of the form @@ -57,6 +56,7 @@ package body Switch.C is procedure Scan_Front_End_Switches (Switch_Chars : String; + Args : Argument_List; Arg_Rank : Positive) is First_Switch : Boolean := True; @@ -677,7 +677,7 @@ package body Switch.C is -- Skip processing if cancelled by subsequent -gnat-p - if Switch_Subsequently_Cancelled ("p", Arg_Rank) then + if Switch_Subsequently_Cancelled ("p", Args, Arg_Rank) then Store_Switch := False; else @@ -1096,25 +1096,17 @@ package body Switch.C is function Switch_Subsequently_Cancelled (C : String; + Args : Argument_List; Arg_Rank : Positive) return Boolean is - Arg : Positive; - Max : constant Natural := Argument_Count; - + use type System.Strings.String_Access; begin -- Loop through arguments following the current one - Arg := Arg_Rank + 1; - while Arg < Max loop - declare - Argv : constant String := Argument (Arg); - begin - if Argv = "-gnat-" & C then - return True; - end if; - end; - - Arg := Arg + 1; + for Arg in Arg_Rank + 1 .. Args'Last loop + if Args (Arg).all = "-gnat-" & C then + return True; + end if; end loop; -- No match found, not cancelled |