Commit cec0185c by Arnaud Charlet Committed by Pierre-Marie de Rodat

[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
parent 940cf495
2018-09-26 Arnaud Charlet <charlet@adacore.com>
* back_end.adb (Scan_Compiler_Arguments): Store -G xxx switches.
2018-09-26 Yannick Moy <moy@adacore.com> 2018-09-26 Yannick Moy <moy@adacore.com>
* errout.ads: Update comment for insertion character '?'. * errout.ads: Update comment for insertion character '?'.
......
...@@ -210,6 +210,9 @@ package body Back_End is ...@@ -210,6 +210,9 @@ package body Back_End is
Next_Arg : Positive; Next_Arg : Positive;
-- Next argument to be scanned -- 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; Output_File_Name_Seen : Boolean := False;
-- Set to True after having scanned file_name for switch "-gnatO file" -- Set to True after having scanned file_name for switch "-gnatO file"
...@@ -234,14 +237,27 @@ package body Back_End is ...@@ -234,14 +237,27 @@ package body Back_End is
Last : constant Natural := Switch_Last (Switch_Chars); Last : constant Natural := Switch_Last (Switch_Chars);
begin 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" if Switch_Chars (First .. Last) = "o"
or else Switch_Chars (First .. Last) = "G"
or else Is_Internal_GCC_Switch (Switch_Chars) or else Is_Internal_GCC_Switch (Switch_Chars)
then then
Next_Arg := Next_Arg + 1; 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 -- Do not record -quiet switch
elsif Switch_Chars (First .. Last) = "quiet" then elsif Switch_Chars (First .. Last) = "quiet" then
...@@ -294,11 +310,6 @@ package body Back_End is ...@@ -294,11 +310,6 @@ package body Back_End is
end if; end if;
end Scan_Back_End_Switches; 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 -- Start of processing for Scan_Compiler_Arguments
begin begin
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment