aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2010-10-05 11:16:23 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2010-10-05 11:16:23 +0200
commit98ee5fc4773c6c7d7d58085d0443a0634b9af809 (patch)
treeffe56e4eccf09211e50b9cad5464ccea1237b0b6
parentde9535785cfc08047ca4f572049ab4dd4e6447f3 (diff)
downloadgcc-98ee5fc4773c6c7d7d58085d0443a0634b9af809.zip
gcc-98ee5fc4773c6c7d7d58085d0443a0634b9af809.tar.gz
gcc-98ee5fc4773c6c7d7d58085d0443a0634b9af809.tar.bz2
[multiple changes]
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
-rw-r--r--gcc/ada/ChangeLog10
-rw-r--r--gcc/ada/make.adb26
-rw-r--r--gcc/ada/xgnatugn.adb6
3 files changed, 36 insertions, 6 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 7aeb5a7..4c5c8c8 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -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
diff --git a/gcc/ada/make.adb b/gcc/ada/make.adb
index 1df76a5..2c2489c 100644
--- a/gcc/ada/make.adb
+++ b/gcc/ada/make.adb
@@ -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
diff --git a/gcc/ada/xgnatugn.adb b/gcc/ada/xgnatugn.adb
index ee3b07d..ab16817 100644
--- a/gcc/ada/xgnatugn.adb
+++ b/gcc/ada/xgnatugn.adb
@@ -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 --
-----------