From 95bcd2a700d3284d3606ddedf18eec22243c1239 Mon Sep 17 00:00:00 2001 From: Arnaud Charlet Date: Thu, 12 Nov 2015 12:00:56 +0000 Subject: [PATCH] switch-c.adb, [...]: Reserve -gnateg for generation of C headers. 2015-11-12 Arnaud Charlet * switch-c.adb, gnat1drv.adb, opt.ads: Reserve -gnateg for generation of C headers. From-SVN: r230248 --- gcc/ada/ChangeLog | 5 +++++ gcc/ada/gnat1drv.adb | 7 ++++++- gcc/ada/opt.ads | 2 +- gcc/ada/switch-c.adb | 6 ++++++ 4 files changed, 18 insertions(+), 2 deletions(-) diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 582a6460b6f..51448ed271f 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,8 @@ +2015-11-12 Arnaud Charlet + + * switch-c.adb, gnat1drv.adb, opt.ads: Reserve -gnateg for generation + of C headers. + 2015-11-12 Arnaud Charlet * back_end.adb, opt.ads (Debugger_Level): Update comment. diff --git a/gcc/ada/gnat1drv.adb b/gcc/ada/gnat1drv.adb index e36533a0ddc..7e5b0671685 100644 --- a/gcc/ada/gnat1drv.adb +++ b/gcc/ada/gnat1drv.adb @@ -142,10 +142,15 @@ procedure Gnat1drv is Modify_Tree_For_C := True; end if; - -- Set all flags required when generating C code (-gnatd.V) + -- -gnatd.V enables C generation if Debug_Flag_Dot_VV then Generate_C_Code := True; + end if; + + -- Set all flags required when generating C code + + if Generate_C_Code then Modify_Tree_For_C := True; Unnest_Subprogram_Mode := True; diff --git a/gcc/ada/opt.ads b/gcc/ada/opt.ads index cacc6a04a55..9e0acdc317e 100644 --- a/gcc/ada/opt.ads +++ b/gcc/ada/opt.ads @@ -704,7 +704,7 @@ package Opt is Generate_C_Code : Boolean := False; -- GNAT -- If True, the Cprint circuitry to generate C code output is activated. - -- Set True by use of -gnatd.V. + -- Set True by use of -gnateg or -gnatd.V. Generate_CodePeer_Messages : Boolean := False; -- GNAT diff --git a/gcc/ada/switch-c.adb b/gcc/ada/switch-c.adb index c3ebbaab332..4f565ceb2f4 100644 --- a/gcc/ada/switch-c.adb +++ b/gcc/ada/switch-c.adb @@ -585,6 +585,12 @@ package body Switch.C is Ptr := Ptr + 1; Check_Float_Overflow := not Machine_Overflows_On_Target; + -- -gnateg (generate C code) + + when 'g' => + Generate_C_Code := True; + Ptr := Ptr + 1; + -- -gnateG (save preprocessor output) when 'G' => -- 2.30.2