Commit 9a080ea3 by Vincent Celier Committed by Arnaud Charlet

prj-part.adb (Parse_Single_Project): Call Is_Extending_All (Extended_Project)…

prj-part.adb (Parse_Single_Project): Call Is_Extending_All (Extended_Project) only if Extended_Project is defined...

2004-10-04  Vincent Celier  <celier@gnat.com>

	* prj-part.adb (Parse_Single_Project): Call Is_Extending_All
	(Extended_Project) only if Extended_Project is defined, to avoid
	assertion error.
	(Post_Parse_Context_Clause): Always call Set_Path_Name_Of with a
	resolved path.
	(Parse_Single_Project): Ditto.

	* prj-env.adb (Set_Ada_Paths.Add.Recursive_Add): Do not call
	Add_To_Project_Path for virtual projects.

From-SVN: r88491
parent 51004cb5
2004-10-04 Vincent Celier <celier@gnat.com> 2004-10-04 Vincent Celier <celier@gnat.com>
* prj-part.adb (Parse_Single_Project): Call Is_Extending_All
(Extended_Project) only if Extended_Project is defined, to avoid
assertion error.
(Post_Parse_Context_Clause): Always call Set_Path_Name_Of with a
resolved path.
(Parse_Single_Project): Ditto.
* prj-env.adb (Set_Ada_Paths.Add.Recursive_Add): Do not call
Add_To_Project_Path for virtual projects.
2004-10-04 Vincent Celier <celier@gnat.com>
* mlib-tgt-tru64.adb, mlib-tgt-aix.adb, mlib-tgt-irix.adb, * mlib-tgt-tru64.adb, mlib-tgt-aix.adb, mlib-tgt-irix.adb,
mlib-tgt-hpux.adb, mlib-tgt-linux.adb, mlib-tgt-solaris.adb, mlib-tgt-hpux.adb, mlib-tgt-linux.adb, mlib-tgt-solaris.adb,
mlib-tgt-vms-alpha.adb, mlib-tgt-vms-ia64.adb, mlib-tgt-mingw.adb, mlib-tgt-vms-alpha.adb, mlib-tgt-vms-ia64.adb, mlib-tgt-mingw.adb,
......
...@@ -1970,10 +1970,10 @@ package body Prj.Env is ...@@ -1970,10 +1970,10 @@ package body Prj.Env is
if Data.Library then if Data.Library then
Add_To_Object_Path (Data.Library_Dir); Add_To_Object_Path (Data.Library_Dir);
else -- For a non-library project, add the object
-- For a non library project, add the object -- directory, if it is not a virtual project.
-- directory.
elsif not Data.Virtual then
Add_To_Object_Path (Data.Object_Directory); Add_To_Object_Path (Data.Object_Directory);
end if; end if;
end if; end if;
......
...@@ -707,6 +707,12 @@ package body Prj.Part is ...@@ -707,6 +707,12 @@ package body Prj.Part is
(Original_Path, (Original_Path,
Project_Directory_Path); Project_Directory_Path);
Resolved_Path : constant String :=
Normalize_Pathname
(Imported_Path_Name,
Resolve_Links => True,
Case_Sensitive => False);
Withed_Project : Project_Node_Id := Empty_Node; Withed_Project : Project_Node_Id := Empty_Node;
begin begin
...@@ -750,21 +756,17 @@ package body Prj.Part is ...@@ -750,21 +756,17 @@ package body Prj.Part is
(Current_Project, Current_With.Path); (Current_Project, Current_With.Path);
Set_Location_Of (Current_Project, Current_With.Location); Set_Location_Of (Current_Project, Current_With.Location);
-- If this is a "limited with", check if we have -- If this is a "limited with", check if we have a circularity.
-- a circularity; if we have one, get the project id -- If we have one, get the project id of the limited imported
-- of the limited imported project file, and don't -- project file, and do not parse it.
-- parse it.
if Limited_With and then Project_Stack.Last > 1 then if Limited_With and then Project_Stack.Last > 1 then
declare declare
Normed : constant String :=
Normalize_Pathname (Imported_Path_Name);
Canonical_Path_Name : Name_Id; Canonical_Path_Name : Name_Id;
begin begin
Name_Len := Normed'Length; Name_Len := Resolved_Path'Length;
Name_Buffer (1 .. Name_Len) := Normed; Name_Buffer (1 .. Name_Len) := Resolved_Path;
Canonical_Case_File_Name (Name_Buffer (1 .. Name_Len));
Canonical_Path_Name := Name_Find; Canonical_Path_Name := Name_Find;
for Index in 1 .. Project_Stack.Last loop for Index in 1 .. Project_Stack.Last loop
...@@ -818,8 +820,9 @@ package body Prj.Part is ...@@ -818,8 +820,9 @@ package body Prj.Part is
To => Withed_Project, To => Withed_Project,
Limited_With => Limited_With); Limited_With => Limited_With);
Set_Name_Of (Current_Project, Name_Of (Withed_Project)); Set_Name_Of (Current_Project, Name_Of (Withed_Project));
Name_Len := Imported_Path_Name'Length;
Name_Buffer (1 .. Name_Len) := Imported_Path_Name; Name_Len := Resolved_Path'Length;
Name_Buffer (1 .. Name_Len) := Resolved_Path;
Set_Path_Name_Of (Current_Project, Name_Find); Set_Path_Name_Of (Current_Project, Name_Find);
if Extends_All then if Extends_All then
...@@ -1038,7 +1041,7 @@ package body Prj.Part is ...@@ -1038,7 +1041,7 @@ package body Prj.Part is
Project := Default_Project_Node (Of_Kind => N_Project); Project := Default_Project_Node (Of_Kind => N_Project);
Project_Stack.Table (Project_Stack.Last).Id := Project; Project_Stack.Table (Project_Stack.Last).Id := Project;
Set_Directory_Of (Project, Project_Directory); Set_Directory_Of (Project, Project_Directory);
Set_Path_Name_Of (Project, Normed_Path_Name); Set_Path_Name_Of (Project, Canonical_Path_Name);
Set_Location_Of (Project, Token_Ptr); Set_Location_Of (Project, Token_Ptr);
Expect (Tok_Project, "PROJECT"); Expect (Tok_Project, "PROJECT");
...@@ -1271,7 +1274,9 @@ package body Prj.Part is ...@@ -1271,7 +1274,9 @@ package body Prj.Part is
-- A project that extends an extending-all project is also -- A project that extends an extending-all project is also
-- an extending-all project. -- an extending-all project.
if Is_Extending_All (Extended_Project) then if Extended_Project /= Empty_Node
and then Is_Extending_All (Extended_Project)
then
Set_Is_Extending_All (Project); Set_Is_Extending_All (Project);
end if; end if;
end if; end if;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment