OSDN Git Service

2011-08-04 Robert Dewar <dewar@adacore.com>
[pf3gnuchains/gcc-fork.git] / gcc / ada / prj-env.adb
index 58f1ec8..100e178 100644 (file)
@@ -476,9 +476,7 @@ package body Prj.Env is
       File_Name : Path_Name_Type  := No_Path;
       File      : File_Descriptor := Invalid_FD;
 
-      Current_Naming  : Naming_Id;
-      Iter            : Source_Iterator;
-      Source          : Source_Id;
+      Current_Naming : Naming_Id;
 
       procedure Check
         (Project : Project_Id;
@@ -509,11 +507,13 @@ package body Prj.Env is
          In_Tree : Project_Tree_Ref;
          State   : in out Integer)
       is
-         pragma Unreferenced (State, In_Tree);
+         pragma Unreferenced (State);
 
          Lang   : constant Language_Ptr :=
                     Get_Language_From_Name (Project, "ada");
          Naming : Lang_Naming_Data;
+         Iter   : Source_Iterator;
+         Source : Source_Id;
 
       begin
          if Current_Verbosity = High then
@@ -528,6 +528,22 @@ package body Prj.Env is
             return;
          end if;
 
+         --  Visit all the files and process those that need an SFN pragma
+
+         Iter := For_Each_Source (In_Tree, Project);
+         while Element (Iter) /= No_Source loop
+            Source := Element (Iter);
+
+            if Source.Index >= 1
+              and then not Source.Locally_Removed
+              and then Source.Unit /= null
+            then
+               Put (Source);
+            end if;
+
+            Next (Iter);
+         end loop;
+
          Naming := Lang.Config.Naming_Data;
 
          --  Is the naming scheme of this project one that we know?
@@ -692,22 +708,6 @@ package body Prj.Env is
          Check_Imported_Projects
            (For_Project, In_Tree, Dummy, Imported_First => False);
 
-         --  Visit all the files and process those that need an SFN pragma
-
-         Iter := For_Each_Source (In_Tree, For_Project);
-         while Element (Iter) /= No_Source loop
-            Source := Element (Iter);
-
-            if Source.Index >= 1
-              and then not Source.Locally_Removed
-              and then Source.Unit /= null
-            then
-               Put (Source);
-            end if;
-
-            Next (Iter);
-         end loop;
-
          --  If there are no non standard naming scheme, issue the GNAT
          --  standard naming scheme. This will tell the compiler that
          --  a project file is used and will forbid any pragma SFN.
@@ -829,6 +829,7 @@ package body Prj.Env is
          Iter   : Source_Iterator;
 
       begin
+         Debug_Output ("Add mapping for project", Project.Name);
          Iter := For_Each_Source (In_Tree, Project, Language => Language);
 
          loop
@@ -901,13 +902,18 @@ package body Prj.Env is
    --  Start of processing for Create_Mapping_File
 
    begin
+      if Current_Verbosity = High then
+         Debug_Output ("Create mapping file for", Debug_Name (In_Tree));
+      end if;
+
       Create_Temp_File (In_Tree.Shared, File, Name, "mapping");
 
       if Current_Verbosity = High then
          Debug_Increase_Indent ("Create mapping file ", Name_Id (Name));
       end if;
 
-      For_Every_Imported_Project (Project, In_Tree, Dummy);
+      For_Every_Imported_Project
+        (Project, In_Tree, Dummy, Include_Aggregated => False);
 
       declare
          Last   : Natural;
@@ -1834,6 +1840,11 @@ package body Prj.Env is
          Self.Path := new String'(Tmp.all & Path_Separator & Path);
          Free (Tmp);
       end if;
+
+      if Current_Verbosity = High then
+         Debug_Output ("Adding directories to Project_Path: """
+                       & Path & '"');
+      end if;
    end Add_Directories;
 
    --------------------