]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[multiple changes]
authorArnaud Charlet <charlet@gcc.gnu.org>
Tue, 5 Oct 2010 09:16:23 +0000 (11:16 +0200)
committerArnaud Charlet <charlet@gcc.gnu.org>
Tue, 5 Oct 2010 09:16:23 +0000 (11:16 +0200)
2010-10-05  Vincent Celier  <celier@adacore.com>

* make.adb (Check): When compiling with -gnatc, recompile if the ALI
file has not been generated for the current source, for example if it
has been generated for the spec, but we are compiling the body.

2010-10-05  Bob Duff  <duff@adacore.com>

* xgnatugn.adb: Remove unused procedure.

From-SVN: r164967

gcc/ada/ChangeLog
gcc/ada/make.adb
gcc/ada/xgnatugn.adb

index 7aeb5a7cb64c1732c55fc38aedce0ddb3fa7320c..4c5c8c8c705ab67e02f1ca2a8c9407d96184fa5d 100644 (file)
@@ -1,3 +1,13 @@
+2010-10-05  Vincent Celier  <celier@adacore.com>
+
+       * make.adb (Check): When compiling with -gnatc, recompile if the ALI
+       file has not been generated for the current source, for example if it
+       has been generated for the spec, but we are compiling the body.
+
+2010-10-05  Bob Duff  <duff@adacore.com>
+
+       * xgnatugn.adb: Remove unused procedure.
+
 2010-10-04  Vincent Celier  <celier@adacore.com>
 
        * a-direct.adb (Copy_File): Interpret the Form parameter and call
index 1df76a514534bfd3d49c852930a092f7925994fc..2c2489c6a37a870f52b94058c55e1069363cb811 100644 (file)
@@ -1658,6 +1658,32 @@ package body Make is
             return;
          end if;
 
+         --  When compiling with -gnatc, don't take ALI file into account if
+         --  it has not been generated for the current source, for example if
+         --  it has been generated for the spec, but we are compiling the body.
+
+         if Operating_Mode = Check_Semantics then
+            declare
+               File_Name : constant String := Get_Name_String (Source_File);
+               OK        : Boolean := False;
+
+            begin
+               for U in ALIs.Table (ALI).First_Unit ..
+                 ALIs.Table (ALI).Last_Unit
+               loop
+                  OK := Get_Name_String (Units.Table (U).Sfile) = File_Name;
+                  exit when OK;
+               end loop;
+
+               if not OK then
+                  Verbose_Msg
+                    (Full_Lib_File, "not generated for the same source");
+                  ALI := No_ALI_Id;
+                  return;
+               end if;
+            end;
+         end if;
+
          --  Check for matching compiler switches if needed
 
          if Check_Switches then
index ee3b07df82052b2bc96e21aa7ea3ac7142a45dee..ab168170f0cf2f2736c565cc9fdaa00a628f3982 100644 (file)
@@ -127,7 +127,6 @@ procedure Xgnatugn is
    --  line-oriented checks (length, character set, trailing spaces).
 
    procedure Put_Line (F : Sfile; S : String);
-   procedure Put_Line (F : Sfile; S : VString);
    --  Local version of Put_Line ensures Unix style line endings
 
    Number_Of_Warnings : Natural := 0;
@@ -369,11 +368,6 @@ procedure Xgnatugn is
       Character'Write (Stream (F), ASCII.LF);
    end Put_Line;
 
-   procedure Put_Line (F : Sfile; S : VString) is
-   begin
-      Put_Line (F, To_String (S));
-   end Put_Line;
-
    -----------
    -- Error --
    -----------