summaryrefslogtreecommitdiff
path: root/gcc/ada/prj-proc.adb
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2004-01-23 10:30:04 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2004-01-23 10:30:04 +0000
commitd5b349fa420e378630f74691c65284888f6d5cca (patch)
tree340e9db670c45f7e10eeb8d937a4635e112b782a /gcc/ada/prj-proc.adb
parent62b02bdf324f4978f124a998d1c1b04709a61fcb (diff)
downloadgcc-d5b349fa420e378630f74691c65284888f6d5cca.tar.gz
2004-01-23 Robert Dewar <dewar@gnat.com>
* exp_aggr.adb: Minor reformatting * exp_ch9.adb: Minor code clean up Minor reformatting Fix bad character in comment * targparm.adb (Get_Target_Parameters): Give clean abort error on unexpected end of file, along with more detailed message. 2004-01-23 Richard Kenner <kenner@vlsi1.ultra.nyu.edu> * exp_pakd.adb (Install_PAT): Clear Freeze_Node for PAT and Etype of PAT. * decl.c (copy_alias_set): New function. (gnat_to_gnu_entity, make_aligning_type, make_packable_type): Use it. 2004-01-23 Doug Rupp <rupp@gnat.com> * Makefile.in (install-gnatlib): Change occurrences of lib$$file to lib$${file} in case subsequent character is not a separator. 2004-01-23 Vincent Celier <celier@gnat.com> * 5vml-tgt.adb (Build_Dynamic_Library): Invoke gcc with -shared-libgcc when the GCC version is at least 3. * make.adb: (Scan_Make_Arg): Pass -B to Scan_Make_Switches Remove all "Opt.", to prepare for opt split * prj-part.adb (Parse_Single_Project): New Boolean out parameter Extends_All. Set to True when the project parsed is an extending all project. Fails for importing an extending all project only when the imported project is an extending all project. (Post_Parse_Context_Clause): Set Is_Extending_All to the with clause, depending on the value of Extends_All returned. * prj-proc.adb (Process): Check that no project shares its object directory with a project that extends it, directly or indirectly, including a virtual project. Check that no project extended by another project shares its object directory with another also extended project. * prj-tree.adb (Is_Extending_All, Set_Is_Extending_All): Allow for Kind = N_With_Clause * prj-tree.ads: Minor reformatting Indicate that Flag2 also applies to N_With_Clause (Is_Extending_All). 2004-01-23 Ed Schonberg <schonberg@gnat.com> * sem_ch13.adb (Analyze_Attribute_Definition_Clause): If the attribute applies to a type with an incomplete view, use full view in Name of clause, for consistency with uses of Get_Attribute_Definition_Clause. 2004-01-23 Arnaud Charlet <charlet@act-europe.fr> * 5itaprop.adb (Set_Priority): Reset the priority to 0 when using SCHED_RR, since other values are not supported by this policy. (Initialize): Move initialization of mutex attribute to package elaboration, to prevent early access to this variable. * Makefile.in: Remove mention of Makefile.adalib, unused. * Makefile.adalib: Removed, unused. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@76403 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/prj-proc.adb')
-rw-r--r--gcc/ada/prj-proc.adb101
1 files changed, 83 insertions, 18 deletions
diff --git a/gcc/ada/prj-proc.adb b/gcc/ada/prj-proc.adb
index e75057a883d..bb550b1b538 100644
--- a/gcc/ada/prj-proc.adb
+++ b/gcc/ada/prj-proc.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 2001-2003 Free Software Foundation, Inc. --
+-- Copyright (C) 2001-2004 Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -817,8 +817,9 @@ package body Prj.Proc is
From_Project_Node : Project_Node_Id;
Report_Error : Put_Line_Access)
is
- Obj_Dir : Name_Id;
- Extending : Project_Id;
+ Obj_Dir : Name_Id;
+ Extending : Project_Id;
+ Extending2 : Project_Id;
begin
Error_Report := Report_Error;
@@ -861,7 +862,7 @@ package body Prj.Proc is
end if;
-- Check that no extended project shares its object directory with
- -- another project.
+ -- another extended project or with its extending project(s).
if Project /= No_Project then
for Extended in 1 .. Projects.Last loop
@@ -870,45 +871,95 @@ package body Prj.Proc is
if Extending /= No_Project then
Obj_Dir := Projects.Table (Extended).Object_Directory;
- for Prj in 1 .. Projects.Last loop
- if Prj /= Extended
- and then Projects.Table (Prj).Sources_Present
- and then Projects.Table (Prj).Object_Directory = Obj_Dir
+ -- Check that a project being extended does not share its
+ -- object directory with any project that extends it, directly
+ -- or indirectly, including a virtual extending project.
+
+ -- Start with the project directly extending it
+
+ Extending2 := Extending;
+
+ while Extending2 /= No_Project loop
+ if Projects.Table (Extending2).Sources_Present
+ and then
+ Projects.Table (Extending2).Object_Directory = Obj_Dir
then
- if Projects.Table (Extending).Virtual then
+ if Projects.Table (Extending2).Virtual then
Error_Msg_Name_1 := Projects.Table (Extended).Name;
if Error_Report = null then
Error_Msg
- ("project % cannot be extended by " &
- "a virtual project",
- Projects.Table (Extending).Location);
+ ("project % cannot be extended by a virtual " &
+ "project with the same object directory",
+ Projects.Table (Extended).Location);
else
Error_Report
("project """ &
Get_Name_String (Error_Msg_Name_1) &
- """ cannot be extended by a virtual project",
+ """ cannot be extended by a virtual " &
+ "project with the same object directory",
Project);
end if;
else
- Error_Msg_Name_1 := Projects.Table (Extending).Name;
+ Error_Msg_Name_1 :=
+ Projects.Table (Extending2).Name;
Error_Msg_Name_2 := Projects.Table (Extended).Name;
if Error_Report = null then
- Error_Msg ("project % cannot extend project %",
- Projects.Table (Extending).Location);
+ Error_Msg
+ ("project % cannot extend project %",
+ Projects.Table (Extending2).Location);
+ Error_Msg
+ ("\they share the same object directory",
+ Projects.Table (Extending2).Location);
else
Error_Report
("project """ &
Get_Name_String (Error_Msg_Name_1) &
""" cannot extend project """ &
- Get_Name_String (Error_Msg_Name_2) & '"',
+ Get_Name_String (Error_Msg_Name_2) & """",
+ Project);
+ Error_Report
+ ("they share the same object directory",
Project);
end if;
end if;
+ end if;
+
+ -- Continue with the next extending project, if any
+
+ Extending2 := Projects.Table (Extending2).Extended_By;
+ end loop;
+
+ -- Check that two projects being extended do not share their
+ -- project directories.
+
+ for Prj in Extended + 1 .. Projects.Last loop
+ Extending2 := Projects.Table (Prj).Extended_By;
+
+ if Extending2 /= No_Project
+ and then Projects.Table (Prj).Sources_Present
+ and then Projects.Table (Prj).Object_Directory = Obj_Dir
+ and then not Projects.Table (Extending).Virtual
+ then
+ Error_Msg_Name_1 := Projects.Table (Extending).Name;
+ Error_Msg_Name_2 := Projects.Table (Extended).Name;
+
+ if Error_Report = null then
+ Error_Msg ("project % cannot extend project %",
+ Projects.Table (Extending).Location);
+
+ else
+ Error_Report
+ ("project """ &
+ Get_Name_String (Error_Msg_Name_1) &
+ """ cannot extend project """ &
+ Get_Name_String (Error_Msg_Name_2) & '"',
+ Project);
+ end if;
Error_Msg_Name_1 := Projects.Table (Extended).Name;
Error_Msg_Name_2 := Projects.Table (Prj).Name;
@@ -924,7 +975,21 @@ package body Prj.Proc is
("project """ &
Get_Name_String (Error_Msg_Name_1) &
""" has the same object directory as project """ &
- Get_Name_String (Error_Msg_Name_2) & '"',
+ Get_Name_String (Error_Msg_Name_2) & """,",
+ Project);
+ end if;
+
+ Error_Msg_Name_1 := Projects.Table (Extending2).Name;
+
+ if Error_Report = null then
+ Error_Msg
+ ("\which is extended by project %",
+ Projects.Table (Extending).Location);
+
+ else
+ Error_Report
+ ("which is extended by project """ &
+ Get_Name_String (Error_Msg_Name_1) & '"',
Project);
end if;