2011-08-29 Johannes Kanig <kanig@adacore.com>
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 29 Aug 2011 09:36:59 +0000 (09:36 +0000)
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 29 Aug 2011 09:36:59 +0000 (09:36 +0000)
* frontend.adb (Frontend): Exit after creating Standard package when
-gnatd.H is present.
* gnat1drv.adb (Gnat1drv): Call Backend right away when -gnatd.H is
present.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@178180 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ada/ChangeLog
gcc/ada/frontend.adb
gcc/ada/gnat1drv.adb

index 04df953..f48eafe 100644 (file)
@@ -1,3 +1,10 @@
+2011-08-29  Johannes Kanig  <kanig@adacore.com>
+
+       * frontend.adb (Frontend): Exit after creating Standard package when
+       -gnatd.H is present.
+       * gnat1drv.adb (Gnat1drv): Call Backend right away when -gnatd.H is
+       present.
+
 2011-08-29  Robert Dewar  <dewar@adacore.com>
 
        * exp_ch9.adb, mlib-prj.adb, prj.adb, prj.ads, ttypes.ads, sem_ch4.adb,
index c6dd8cb..f849d31 100644 (file)
@@ -98,6 +98,12 @@ begin
 
    CStand.Create_Standard;
 
+   --  If the -gnatd.H flag is present, we are only interested in the Standard
+   --  package, so the frontend has done its job here.
+   if Debug_Flag_Dot_HH then
+      return;
+   end if;
+
    --  Check possible symbol definitions specified by -gnateD switches
 
    Prepcomp.Process_Command_Line_Symbol_Definitions;
index febce1b..b494bd4 100644 (file)
@@ -771,8 +771,23 @@ begin
       Frontend;
 
       --  Exit with errors if the main source could not be parsed
-
+      --  Also, when -gnatd.H is present, the source file is not set.
       if Sinput.Main_Source_File = No_Source_File then
+         if Debug_Flag_Dot_HH then
+            --  We lock all the tables to keep the convention that the backend
+            --  needs to unlock the tables it wants to touch.
+            Atree.Lock;
+            Elists.Lock;
+            Fname.UF.Lock;
+            Inline.Lock;
+            Lib.Lock;
+            Nlists.Lock;
+            Sem.Lock;
+            Sinput.Lock;
+            Namet.Lock;
+            Stringt.Lock;
+            Back_End.Call_Back_End (Back_End.Generate_Object);
+         end if;
          Errout.Finalize (Last_Call => True);
          Errout.Output_Messages;
          Exit_Program (E_Errors);