diff options
author | Arnaud Charlet <charlet@adacore.com> | 2020-10-09 09:49:57 +0200 |
---|---|---|
committer | Pierre-Marie de Rodat <derodat@adacore.com> | 2020-11-24 05:16:07 -0500 |
commit | eafca96ffb53fdd805193635fda8b1e718532f2a (patch) | |
tree | 1c7d6740b0871153b5aacbf0e21dc9d1fa5d8a51 | |
parent | bfe5f951ce9d7fb205aa08d5a6dad699398417d9 (diff) | |
download | gcc-eafca96ffb53fdd805193635fda8b1e718532f2a.zip gcc-eafca96ffb53fdd805193635fda8b1e718532f2a.tar.gz gcc-eafca96ffb53fdd805193635fda8b1e718532f2a.tar.bz2 |
[Ada] Cannot process -S -o with GNAT LLVM
gcc/ada/
* opt.ads (Generate_Asm): New flag.
* osint-c.adb (Set_Output_Object_File_Name): Accept any
extension when generating assembly.
* adabkend.adb (Scan_Compiler_Args): Recognize -S.
-rw-r--r-- | gcc/ada/adabkend.adb | 3 | ||||
-rw-r--r-- | gcc/ada/opt.ads | 4 | ||||
-rw-r--r-- | gcc/ada/osint-c.adb | 1 |
3 files changed, 8 insertions, 0 deletions
diff --git a/gcc/ada/adabkend.adb b/gcc/ada/adabkend.adb index 6fb4a84..b10c0bd 100644 --- a/gcc/ada/adabkend.adb +++ b/gcc/ada/adabkend.adb @@ -218,6 +218,9 @@ package body Adabkend is end case; end if; + elsif Switch_Chars (First .. Last) = "S" then + Generate_Asm := True; + -- Ignore all other back-end switches elsif Is_Back_End_Switch (Switch_Chars) then diff --git a/gcc/ada/opt.ads b/gcc/ada/opt.ads index 3e9f36e..5017792 100644 --- a/gcc/ada/opt.ads +++ b/gcc/ada/opt.ads @@ -719,6 +719,10 @@ package Opt is -- the name is of the form .xxx, then to name.xxx where name is the source -- file name with extension stripped. + Generate_Asm : Boolean := False; + -- GNAT + -- True if generating assembly instead of an object file, via the -S switch + Generate_C_Code : Boolean := False; -- GNAT, GNATBIND -- If True, the Cprint circuitry to generate C code output is activated. diff --git a/gcc/ada/osint-c.adb b/gcc/ada/osint-c.adb index 0010a8d..8ef8b8b 100644 --- a/gcc/ada/osint-c.adb +++ b/gcc/ada/osint-c.adb @@ -480,6 +480,7 @@ package body Osint.C is or else (Name (NL - EL + Name'First .. Name'Last) /= Ext and then Name (NL - 2 + Name'First .. Name'Last) /= ".o" + and then not Generate_Asm and then (not Generate_C_Code or else Name (NL - 2 + Name'First .. Name'Last) /= ".c")) |