From: Arnaud Charlet <charlet@adacore.com>
gcc/ada/
* bindgen.adb (Gen_Main): Put back support for -G
* bindusg.adb (Display): Put back line for -G
* opt.ads (CCG_Mode): Update doc
* switch-b.adb (Scan_Binder_Switches): Put back support for -G
Tested on x86_64-pc-linux-gnu, committed on master.
---
gcc/ada/bindgen.adb | 1 +
gcc/ada/bindusg.adb | 5 +++++
gcc/ada/opt.ads | 4 +++-
gcc/ada/switch-b.adb | 6 ++++++
4 files changed, 15 insertions(+), 1 deletion(-)
@@ -2113,6 +2113,7 @@ package body Bindgen is
if Bind_Main_Program
and then not Minimal_Binder
and then not CodePeer_Mode
+ and then not CCG_Mode
then
WBI (" Ensure_Reference : aliased System.Address := " &
"Ada_Main_Program_Name'Address;");
@@ -133,6 +133,11 @@ package body Bindusg is
Write_Line
(" -F Force checking of elaboration Flags");
+ -- Line for -G switch
+
+ Write_Line
+ (" -G Generate binder file suitable for CCG");
+
-- Line for -h switch
Write_Line
@@ -261,7 +261,9 @@ package Opt is
-- (switch -B)
CCG_Mode : Boolean := False;
- -- Set to True when running as CCG (either via -gnatceg or via -emit-c)
+ -- GNAT, GNATBIND
+ -- Set to True when running as CCG (implicitly, via -emit-c, or -G for the
+ -- binder)
Check_Aliasing_Of_Parameters : Boolean := False;
-- GNAT
@@ -362,6 +362,12 @@ package body Switch.B is
Debugger_Level := 2;
end if;
+ -- Processing for G switch
+
+ when 'G' =>
+ Ptr := Ptr + 1;
+ CCG_Mode := True;
+
-- Processing for h switch
when 'h' =>