prj.adb: Minor code refactoring.
authorPascal Obry <obry@adacore.com>
Fri, 2 Sep 2011 09:04:38 +0000 (09:04 +0000)
committerArnaud Charlet <charlet@gcc.gnu.org>
Fri, 2 Sep 2011 09:04:38 +0000 (11:04 +0200)
2011-09-02  Pascal Obry  <obry@adacore.com>

* prj.adb: Minor code refactoring. Move check for null project in
Project_Changed.
* projects.texi: Fix minor typos.

From-SVN: r178444

gcc/ada/ChangeLog
gcc/ada/prj.adb
gcc/ada/projects.texi

index f71dfc16f7aa821f6e9bebf02befc645b3c7d175..9a5fdea93c243ec6eae5d989bd97be2ae7902a16 100644 (file)
@@ -1,3 +1,9 @@
+2011-09-02  Pascal Obry  <obry@adacore.com>
+
+       * prj.adb: Minor code refactoring. Move check for null project in
+       Project_Changed.
+       * projects.texi: Fix minor typos.
+
 2011-09-02  Ed Schonberg  <schonberg@adacore.com>
 
        * sem_ch5.adb (Analyze_Iterator_Specification): If the domain
index 124536136d7cf779a11fcfb944d9b3c1a7c964cd..acf1bbe374119a06f4cf28b7f0386ea66ff58838 100644 (file)
@@ -366,8 +366,10 @@ package body Prj is
 
    procedure Project_Changed (Iter : in out Source_Iterator) is
    begin
-      Iter.Language := Iter.Project.Project.Languages;
-      Language_Changed (Iter);
+      if Iter.Project /= null then
+         Iter.Language := Iter.Project.Project.Languages;
+         Language_Changed (Iter);
+      end if;
    end Project_Changed;
 
    ----------------------
@@ -392,9 +394,7 @@ package body Prj is
          if Iter.All_Projects then
             Iter.Project := Iter.Project.Next;
 
-            if Iter.Project /= null then
-               Project_Changed (Iter);
-            end if;
+            Project_Changed (Iter);
 
          else
             Iter.Project := null;
@@ -493,7 +493,6 @@ package body Prj is
          Tree    : Project_Tree_Ref)
       is
          List : Project_List;
-         Agg  : Aggregated_Project_List;
 
       begin
          if not Get (Seen, Project) then
@@ -525,12 +524,16 @@ package body Prj is
             if Include_Aggregated
               and then Project.Qualifier = Aggregate
             then
-               Agg := Project.Aggregated_Projects;
-               while Agg /= null loop
-                  pragma Assert (Agg.Project /= No_Project);
-                  Recursive_Check (Agg.Project, Agg.Tree);
-                  Agg := Agg.Next;
-               end loop;
+               declare
+                  Agg : Aggregated_Project_List;
+               begin
+                  Agg := Project.Aggregated_Projects;
+                  while Agg /= null loop
+                     pragma Assert (Agg.Project /= No_Project);
+                     Recursive_Check (Agg.Project, Agg.Tree);
+                     Agg := Agg.Next;
+                  end loop;
+               end;
             end if;
 
             if Imported_First then
index 6f87ba5a011208a5feb9c577659cbaced485d273..ff0fac7df15e01dd16be0085eeaf70430c65c2b7 100644 (file)
@@ -2307,7 +2307,7 @@ attributes and packages are forbidden in an aggregate project. Here is the
 
 @itemize @bullet
 @item Languages
-@item Source_files, Source_List_File and other attributes dealing with
+@item Source_Files, Source_List_File and other attributes dealing with
   list of sources.
 @item Source_Dirs, Exec_Dir and Object_Dir
 @item Library_Dir, Library_Name and other library-related attributes
@@ -2317,7 +2317,7 @@ attributes and packages are forbidden in an aggregate project. Here is the
 @item Inherit_Source_Path
 @item Excluded_Source_Dirs
 @item Locally_Removed_Files
-@item Excluded_Source_Fies
+@item Excluded_Source_Files
 @item Excluded_Source_List_File
 @item Interfaces
 @end itemize