diff options
Diffstat (limited to 'gcc/ada')
-rw-r--r-- | gcc/ada/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/ada/back_end.adb | 25 |
2 files changed, 22 insertions, 7 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index f8281bd..5e0adf4 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,7 @@ +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> * errout.ads: Update comment for insertion character '?'. 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 |