OSDN Git Service

Daily bump.
[pf3gnuchains/gcc-fork.git] / gcc / ada / prj-pars.adb
index fa85c8c..b76a77f 100644 (file)
@@ -6,7 +6,7 @@
 --                                                                          --
 --                                 B o d y                                  --
 --                                                                          --
---          Copyright (C) 2001-2009, Free Software Foundation, Inc.         --
+--          Copyright (C) 2001-2011, 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- --
@@ -43,21 +43,24 @@ package body Prj.Pars is
      (In_Tree           : Project_Tree_Ref;
       Project           : out Project_Id;
       Project_File_Name : String;
-      Packages_To_Check : String_List_Access := All_Packages;
-      When_No_Sources   : Error_Warning := Error;
-      Report_Error      : Put_Line_Access := null;
-      Reset_Tree        : Boolean := True)
+      Packages_To_Check : String_List_Access;
+      Reset_Tree        : Boolean := True;
+      In_Node_Tree      : Prj.Tree.Project_Node_Tree_Ref := null;
+      Env               : in out Prj.Tree.Environment)
    is
-      Project_Node      : Project_Node_Id := Empty_Node;
-      The_Project       : Project_Id      := No_Project;
-      Success           : Boolean         := True;
-      Current_Dir       : constant String := Get_Current_Dir;
-      Project_Node_Tree : Prj.Tree.Project_Node_Tree_Ref;
+      Project_Node            : Project_Node_Id := Empty_Node;
+      The_Project             : Project_Id      := No_Project;
+      Success                 : Boolean         := True;
+      Current_Dir             : constant String := Get_Current_Dir;
+      Project_Node_Tree       : Prj.Tree.Project_Node_Tree_Ref := In_Node_Tree;
       Automatically_Generated : Boolean;
       Config_File_Path        : String_Access;
+
    begin
-      Project_Node_Tree := new Project_Node_Tree_Data;
-      Prj.Tree.Initialize (Project_Node_Tree);
+      if Project_Node_Tree = null then
+         Project_Node_Tree := new Project_Node_Tree_Data;
+         Prj.Tree.Initialize (Project_Node_Tree);
+      end if;
 
       --  Parse the main project file into a tree
 
@@ -66,9 +69,10 @@ package body Prj.Pars is
         (In_Tree                => Project_Node_Tree,
          Project                => Project_Node,
          Project_File_Name      => Project_File_Name,
-         Always_Errout_Finalize => False,
+         Errout_Handling        => Prj.Part.Finalize_If_Error,
          Packages_To_Check      => Packages_To_Check,
          Current_Directory      => Current_Dir,
+         Env                    => Env,
          Is_Config_File         => False);
 
       --  If there were no error, process the tree
@@ -90,14 +94,11 @@ package body Prj.Pars is
                Allow_Automatic_Generation => False,
                Automatically_Generated    => Automatically_Generated,
                Config_File_Path           => Config_File_Path,
-               Report_Error               => Report_Error,
+               Env                        => Env,
                Normalized_Hostname        => "",
-               Compiler_Driver_Mandatory  => False,
-               Allow_Duplicate_Basenames  => False,
                On_Load_Config             =>
                  Add_Default_GNAT_Naming_Scheme'Access,
-               Reset_Tree                 => Reset_Tree,
-               When_No_Sources            => When_No_Sources);
+               Reset_Tree                 => Reset_Tree);
 
             Success := The_Project /= No_Project;