OSDN Git Service

2006-10-31 Ed Schonberg <schonberg@adacore.com>
[pf3gnuchains/gcc-fork.git] / gcc / ada / prj.adb
index 8158de7..7f85ed3 100644 (file)
@@ -6,7 +6,7 @@
 --                                                                          --
 --                                 B o d y                                  --
 --                                                                          --
---             Copyright (C) 2001-2005 Free Software Foundation, Inc.       --
+--          Copyright (C) 2001-2006, 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- --
@@ -16,8 +16,8 @@
 -- or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License --
 -- for  more details.  You should have  received  a copy of the GNU General --
 -- Public License  distributed with GNAT;  see file COPYING.  If not, write --
--- to  the Free Software Foundation,  59 Temple Place - Suite 330,  Boston, --
--- MA 02111-1307, USA.                                                      --
+-- to  the  Free Software Foundation,  51  Franklin  Street,  Fifth  Floor, --
+-- Boston, MA 02110-1301, USA.                                              --
 --                                                                          --
 -- GNAT was originally developed  by the GNAT team at  New York University. --
 -- Extensive contributions were provided by Ada Core Technologies Inc.      --
@@ -32,12 +32,10 @@ with Osint;    use Osint;
 with Prj.Attr;
 with Prj.Env;
 with Prj.Err;  use Prj.Err;
-with Scans;    use Scans;
 with Snames;   use Snames;
 with Uintp;    use Uintp;
 
 with GNAT.Case_Util; use GNAT.Case_Util;
-with GNAT.OS_Lib;    use GNAT.OS_Lib;
 
 package body Prj is
 
@@ -90,6 +88,7 @@ package body Prj is
       Supp_Languages                 => No_Supp_Language_Index,
       First_Referred_By              => No_Project,
       Name                           => No_Name,
+      Display_Name                   => No_Name,
       Path_Name                      => No_Name,
       Display_Path_Name              => No_Name,
       Virtual                        => False,
@@ -103,6 +102,8 @@ package body Prj is
       Display_Library_Dir            => No_Name,
       Library_Src_Dir                => No_Name,
       Display_Library_Src_Dir        => No_Name,
+      Library_ALI_Dir                => No_Name,
+      Display_Library_ALI_Dir        => No_Name,
       Library_Name                   => No_Name,
       Library_Kind                   => Static,
       Lib_Internal_Name              => No_Name,
@@ -122,6 +123,7 @@ package body Prj is
       Known_Order_Of_Source_Dirs     => True,
       Object_Directory               => No_Name,
       Display_Object_Dir             => No_Name,
+      Library_TS                     => Empty_Time_Stamp,
       Exec_Directory                 => No_Name,
       Display_Exec_Dir               => No_Name,
       Extends                        => No_Project,
@@ -133,6 +135,7 @@ package body Prj is
       Default_Linker_Path            => No_Name,
       Decl                           => No_Declarations,
       Imported_Projects              => Empty_Project_List,
+      All_Imported_Projects          => Empty_Project_List,
       Ada_Include_Path               => null,
       Ada_Objects_Path               => null,
       Include_Path_File              => No_Name,
@@ -227,9 +230,10 @@ package body Prj is
    -------------------
 
    function Empty_Project (Tree : Project_Tree_Ref)  return Project_Data is
-      Value : Project_Data := Project_Empty;
+      Value : Project_Data;
    begin
       Prj.Initialize (Tree => No_Project_Tree);
+      Value := Project_Empty;
       Value.Naming := Tree.Private_Part.Default_Naming;
       return Value;
    end Empty_Project;
@@ -485,7 +489,7 @@ package body Prj is
          end if;
       end loop;
 
-      --  If none can be found, create a new one.
+      --  If none can be found, create a new one
 
       if not Found then
          Element :=
@@ -526,7 +530,7 @@ package body Prj is
          end if;
       end loop;
 
-      --  If none can be found, create a new one.
+      --  If none can be found, create a new one
 
       if not Found then
          Element :=
@@ -573,6 +577,9 @@ package body Prj is
       Units_Htable.Reset          (Tree.Units_HT);
       Files_Htable.Reset          (Tree.Files_HT);
       Naming_Table.Init           (Tree.Private_Part.Namings);
+      Naming_Table.Increment_Last (Tree.Private_Part.Namings);
+      Tree.Private_Part.Namings.Table
+        (Naming_Table.Last (Tree.Private_Part.Namings)) := Std_Naming_Data;
       Path_File_Table.Init        (Tree.Private_Part.Path_Files);
       Source_Path_Table.Init      (Tree.Private_Part.Source_Paths);
       Object_Path_Table.Init      (Tree.Private_Part.Object_Paths);
@@ -650,7 +657,7 @@ package body Prj is
    end Set;
 
    procedure Set
-     (Language_Processing : in Language_Processing_Data;
+     (Language_Processing : Language_Processing_Data;
       For_Language        : Language_Index;
       In_Project          : in out Project_Data;
       In_Tree             : Project_Tree_Ref)
@@ -672,8 +679,7 @@ package body Prj is
 
             begin
                while Supp_Index /= No_Supp_Language_Index loop
-                  Supp := In_Tree.Supp_Languages.Table
-                                                                (Supp_Index);
+                  Supp := In_Tree.Supp_Languages.Table (Supp_Index);
 
                   if Supp.Index = For_Language then
                      In_Tree.Supp_Languages.Table
@@ -755,8 +761,8 @@ package body Prj is
    -- Standard_Naming_Data --
    --------------------------
 
-   function Standard_Naming_Data (Tree : Project_Tree_Ref := No_Project_Tree)
-                                  return Naming_Data
+   function Standard_Naming_Data
+     (Tree : Project_Tree_Ref := No_Project_Tree) return Naming_Data
    is
    begin
       if Tree = No_Project_Tree then
@@ -793,8 +799,7 @@ package body Prj is
 
             begin
                while Supp_Index /= No_Supp_Language_Index loop
-                  Supp := In_Tree.Supp_Suffixes.Table
-                                                             (Supp_Index);
+                  Supp := In_Tree.Supp_Suffixes.Table (Supp_Index);
 
                   if Supp.Index = Language then
                      return Supp.Suffix;