aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/back_end.adb
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@adacore.com>2018-09-26 09:19:47 +0000
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>2018-09-26 09:19:47 +0000
commitcec0185c7e02aa52ffceddbf46a16a66ed47459c (patch)
tree91e1476768c5868288406ab2e4918fb817cb1ed9 /gcc/ada/back_end.adb
parent940cf4955f1dbe6ff07677967bfd7f6d00cba6db (diff)
downloadgcc-cec0185c7e02aa52ffceddbf46a16a66ed47459c.zip
gcc-cec0185c7e02aa52ffceddbf46a16a66ed47459c.tar.gz
gcc-cec0185c7e02aa52ffceddbf46a16a66ed47459c.tar.bz2
[Ada] Store -G xxx switches
2018-09-26 Arnaud Charlet <charlet@adacore.com> gcc/ada/ * back_end.adb (Scan_Compiler_Arguments): Store -G xxx switches. From-SVN: r264634
Diffstat (limited to 'gcc/ada/back_end.adb')
-rw-r--r--gcc/ada/back_end.adb25
1 files changed, 18 insertions, 7 deletions
diff --git a/gcc/ada/back_end.adb b/gcc/ada/back_end.adb
index 520a8b2..61ab718 100644
--- a/gcc/ada/back_end.adb
+++ b/gcc/ada/back_end.adb
@@ -210,6 +210,9 @@ package body Back_End is
Next_Arg : Positive;
-- Next argument to be scanned
+ Arg_Count : constant Natural := Natural (save_argc - 1);
+ Args : Argument_List (1 .. Arg_Count);
+
Output_File_Name_Seen : Boolean := False;
-- Set to True after having scanned file_name for switch "-gnatO file"
@@ -234,14 +237,27 @@ package body Back_End is
Last : constant Natural := Switch_Last (Switch_Chars);
begin
- -- Skip -o, -G or internal GCC switches together with their argument.
+ -- Skip -o or internal GCC switches together with their argument.
if Switch_Chars (First .. Last) = "o"
- or else Switch_Chars (First .. Last) = "G"
or else Is_Internal_GCC_Switch (Switch_Chars)
then
Next_Arg := Next_Arg + 1;
+ -- Store -G xxx as -Gxxx and go directly to the next argument.
+
+ elsif Switch_Chars (First .. Last) = "G" then
+ Next_Arg := Next_Arg + 1;
+
+ -- Should never get there with -G not followed by an argument,
+ -- but use defensive code nonetheless.
+ -- Store as -Gxxx to avoid storing parameters in ALI files that
+ -- might create confusion.
+
+ if Next_Arg <= Args'Last then
+ Store_Compilation_Switch (Switch_Chars & Args (Next_Arg).all);
+ end if;
+
-- Do not record -quiet switch
elsif Switch_Chars (First .. Last) = "quiet" then
@@ -294,11 +310,6 @@ package body Back_End is
end if;
end Scan_Back_End_Switches;
- -- Local variables
-
- Arg_Count : constant Natural := Natural (save_argc - 1);
- Args : Argument_List (1 .. Arg_Count);
-
-- Start of processing for Scan_Compiler_Arguments
begin