aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Celier <celier@adacore.com>2010-06-22 10:15:49 +0000
committerArnaud Charlet <charlet@gcc.gnu.org>2010-06-22 12:15:49 +0200
commit3a4ec5cc08d808313a7e0d820193a9c405a313c5 (patch)
tree56d633654fe6f2bed93cd50b3d290cd7887f5139
parent47d3b920ce09b27fca7dc6504640f6fe72fb16cf (diff)
downloadgcc-3a4ec5cc08d808313a7e0d820193a9c405a313c5.zip
gcc-3a4ec5cc08d808313a7e0d820193a9c405a313c5.tar.gz
gcc-3a4ec5cc08d808313a7e0d820193a9c405a313c5.tar.bz2
bindusg.adb (Display): Update line for -R
2010-06-22 Vincent Celier <celier@adacore.com> * bindusg.adb (Display): Update line for -R * switch-b.adb (Scan_Binder_Switches): Allow generation of the binder generated files when -R is used. 2010-06-22 Vincent Celier <celier@adacore.com> * prj-nmsc.adb (Lib_Data_Table): New table. (Check_Library_Attributes): Check if the same library name is used in two different projects that do not extend each other. From-SVN: r161161
-rw-r--r--gcc/ada/ChangeLog12
-rw-r--r--gcc/ada/bindusg.adb2
-rw-r--r--gcc/ada/prj-nmsc.adb54
-rw-r--r--gcc/ada/switch-b.adb1
4 files changed, 66 insertions, 3 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 2b2728c..df1bc71 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,15 @@
+2010-06-22 Vincent Celier <celier@adacore.com>
+
+ * bindusg.adb (Display): Update line for -R
+ * switch-b.adb (Scan_Binder_Switches): Allow generation of the binder
+ generated files when -R is used.
+
+2010-06-22 Vincent Celier <celier@adacore.com>
+
+ * prj-nmsc.adb (Lib_Data_Table): New table.
+ (Check_Library_Attributes): Check if the same library name is used in
+ two different projects that do not extend each other.
+
2010-06-22 Robert Dewar <dewar@adacore.com>
* lib-writ.ads, errout.adb, einfo.adb, einfo.ads: Minor reformatting.
diff --git a/gcc/ada/bindusg.adb b/gcc/ada/bindusg.adb
index 4702d82..bfab363 100644
--- a/gcc/ada/bindusg.adb
+++ b/gcc/ada/bindusg.adb
@@ -181,7 +181,7 @@ package body Bindusg is
-- Line for -R switch
Write_Line
- (" -R List sources referenced in closure (implies -c)");
+ (" -R List sources referenced in closure");
-- Line for -s switch
diff --git a/gcc/ada/prj-nmsc.adb b/gcc/ada/prj-nmsc.adb
index 498a01e..f16f6e7 100644
--- a/gcc/ada/prj-nmsc.adb
+++ b/gcc/ada/prj-nmsc.adb
@@ -26,6 +26,7 @@
with GNAT.Case_Util; use GNAT.Case_Util;
with GNAT.Directory_Operations; use GNAT.Directory_Operations;
with GNAT.Dynamic_HTables;
+with GNAT.Table;
with Err_Vars; use Err_Vars;
with Opt; use Opt;
@@ -157,6 +158,20 @@ package body Prj.Nmsc is
-- This data must be initialized before processing any project, and the
-- same data is used for processing all projects in the tree.
+ type Lib_Data is record
+ Name : Name_Id;
+ Proj : Project_Id;
+ end record;
+
+ package Lib_Data_Table is new GNAT.Table
+ (Table_Component_Type => Lib_Data,
+ Table_Index_Type => Positive,
+ Table_Low_Bound => 1,
+ Table_Initial => 10,
+ Table_Increment => 100);
+ -- A table to record library names in order to check that two library
+ -- projects do not have the same library names.
+
procedure Initialize
(Data : out Tree_Processing_Data;
Tree : Project_Tree_Ref;
@@ -4083,9 +4098,46 @@ package body Prj.Nmsc is
end;
end if;
- if Project.Extends /= No_Project then
+ if Project.Extends /= No_Project and then Project.Extends.Library then
+
+ -- Remove the library name from Lib_Data_Table
+
+ for J in 1 .. Lib_Data_Table.Last loop
+ if Lib_Data_Table.Table (J).Proj = Project.Extends then
+ Lib_Data_Table.Table (J) :=
+ Lib_Data_Table.Table (Lib_Data_Table.Last);
+ Lib_Data_Table.Set_Last (Lib_Data_Table.Last - 1);
+ exit;
+ end if;
+ end loop;
+
Project.Extends.Library := False;
end if;
+
+ if Project.Library and then not Lib_Name.Default then
+
+ -- Check if the same library name is used in an other library project
+
+ for J in 1 .. Lib_Data_Table.Last loop
+ if Lib_Data_Table.Table (J).Name = Project.Library_Name then
+ Error_Msg_Name_1 := Lib_Data_Table.Table (J).Proj.Name;
+ Error_Msg
+ (Data.Flags,
+ "Library name cannot be the same as in project %%",
+ Lib_Name.Location, Project);
+ Project.Library := False;
+ exit;
+ end if;
+ end loop;
+ end if;
+
+ if Project.Library then
+
+ -- Record the library name
+
+ Lib_Data_Table.Append
+ ((Name => Project.Library_Name, Proj => Project));
+ end if;
end Check_Library_Attributes;
---------------------------------
diff --git a/gcc/ada/switch-b.adb b/gcc/ada/switch-b.adb
index 705f9a3..8a22eb0 100644
--- a/gcc/ada/switch-b.adb
+++ b/gcc/ada/switch-b.adb
@@ -366,7 +366,6 @@ package body Switch.B is
when 'R' =>
Ptr := Ptr + 1;
- Check_Only := True;
List_Closure := True;
-- Processing for s switch