diff options
author | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-07-13 09:16:31 +0000 |
---|---|---|
committer | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-07-13 09:16:31 +0000 |
commit | 4eafea4c70890f237b2331faf5fa43dbb27bfbdd (patch) | |
tree | 50fe25cb1308810069cefd58d6ccb0397db77aaa /gcc/ada/prj-proc.adb | |
parent | 189243d59e89001449ec294fa1ff7816c7ef68f3 (diff) | |
download | ppe42-gcc-4eafea4c70890f237b2331faf5fa43dbb27bfbdd.tar.gz ppe42-gcc-4eafea4c70890f237b2331faf5fa43dbb27bfbdd.zip |
2009-07-13 Emmanuel Briot <briot@adacore.com>
* prj-proc.adb, prj-proc.ads, prj.ads, prj-nmsc.adb, prj-nmsc.ads,
prj-pars.adb, prj-conf.adb, prj-conf.ads: Remove all remaining global
variables and tables in prj-nmsc.adb.
(Tree_Processing_Data): Renames Processing_Data, some new fields added
(Project_Processing_Data): New record
Simplify/unify check for missing sources.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@149558 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/prj-proc.adb')
-rw-r--r-- | gcc/ada/prj-proc.adb | 114 |
1 files changed, 53 insertions, 61 deletions
diff --git a/gcc/ada/prj-proc.adb b/gcc/ada/prj-proc.adb index 4c45642bf0d..ef398133bde 100644 --- a/gcc/ada/prj-proc.adb +++ b/gcc/ada/prj-proc.adb @@ -79,17 +79,16 @@ package body Prj.Proc is -- the package or project with declarations Decl. procedure Check - (In_Tree : Project_Tree_Ref; - Project : Project_Id; - Current_Dir : String; - When_No_Sources : Error_Warning; - Is_Config_File : Boolean; - Compiler_Driver_Mandatory : Boolean; - Allow_Duplicate_Basenames : Boolean); + (In_Tree : Project_Tree_Ref; + Project : Project_Id; + Current_Dir : String; + When_No_Sources : Error_Warning; + Require_Sources_Other_Lang : Boolean; + Compiler_Driver_Mandatory : Boolean; + Allow_Duplicate_Basenames : Boolean); -- Set all projects to not checked, then call Recursive_Check for the -- main project Project. Project is set to No_Project if errors occurred. -- Current_Dir is for optimization purposes, avoiding extra system calls. - -- Is_Config_File should be True if Project is a config file (.cgpr). -- If Allow_Duplicate_Basenames, then files with the same base names are -- authorized within a project for source-based languages (never for unit -- based languages) @@ -152,13 +151,8 @@ package body Prj.Proc is -- project. type Recursive_Check_Data is record - In_Tree : Project_Tree_Ref; Current_Dir : String_Access; - When_No_Sources : Error_Warning; - Proc_Data : Processing_Data; - Is_Config_File : Boolean; - Compiler_Driver_Mandatory : Boolean; - Allow_Duplicate_Basenames : Boolean; + Proc_Data : Tree_Processing_Data; end record; -- Data passed to Recursive_Check -- Current_Dir is for optimization purposes, avoiding extra system calls. @@ -285,13 +279,13 @@ package body Prj.Proc is ----------- procedure Check - (In_Tree : Project_Tree_Ref; - Project : Project_Id; - Current_Dir : String; - When_No_Sources : Error_Warning; - Is_Config_File : Boolean; - Compiler_Driver_Mandatory : Boolean; - Allow_Duplicate_Basenames : Boolean) + (In_Tree : Project_Tree_Ref; + Project : Project_Id; + Current_Dir : String; + When_No_Sources : Error_Warning; + Require_Sources_Other_Lang : Boolean; + Compiler_Driver_Mandatory : Boolean; + Allow_Duplicate_Basenames : Boolean) is Dir : aliased String := Current_Dir; @@ -301,14 +295,16 @@ package body Prj.Proc is Data : Recursive_Check_Data; begin - Data.In_Tree := In_Tree; Data.Current_Dir := Dir'Unchecked_Access; - Data.When_No_Sources := When_No_Sources; - Data.Is_Config_File := Is_Config_File; - Data.Compiler_Driver_Mandatory := Compiler_Driver_Mandatory; - Data.Allow_Duplicate_Basenames := Allow_Duplicate_Basenames; - Initialize (Data.Proc_Data); + Initialize + (Data.Proc_Data, + Tree => In_Tree, + Allow_Duplicate_Basenames => Allow_Duplicate_Basenames, + Require_Sources_Other_Lang => Require_Sources_Other_Lang, + Compiler_Driver_Mandatory => Compiler_Driver_Mandatory, + When_No_Sources => When_No_Sources, + Report_Error => null); Check_All_Projects (Project, Data, Imported_First => True); @@ -1244,8 +1240,7 @@ package body Prj.Proc is Report_Error : Put_Line_Access; When_No_Sources : Error_Warning := Error; Reset_Tree : Boolean := True; - Current_Dir : String := ""; - Is_Config_File : Boolean) + Current_Dir : String := "") is begin Process_Project_Tree_Phase_1 @@ -1257,19 +1252,21 @@ package body Prj.Proc is Report_Error => Report_Error, Reset_Tree => Reset_Tree); - if not Is_Config_File then + if Project_Qualifier_Of (From_Project_Node, From_Project_Node_Tree) /= + Configuration + then Process_Project_Tree_Phase_2 - (In_Tree => In_Tree, - Project => Project, - Success => Success, - From_Project_Node => From_Project_Node, - From_Project_Node_Tree => From_Project_Node_Tree, - Report_Error => Report_Error, - When_No_Sources => When_No_Sources, - Current_Dir => Current_Dir, - Compiler_Driver_Mandatory => True, - Allow_Duplicate_Basenames => False, - Is_Config_File => Is_Config_File); + (In_Tree => In_Tree, + Project => Project, + Success => Success, + From_Project_Node => From_Project_Node, + From_Project_Node_Tree => From_Project_Node_Tree, + Report_Error => Report_Error, + When_No_Sources => When_No_Sources, + Current_Dir => Current_Dir, + Require_Sources_Other_Lang => False, + Compiler_Driver_Mandatory => True, + Allow_Duplicate_Basenames => False); end if; end Process; @@ -2315,17 +2312,17 @@ package body Prj.Proc is ---------------------------------- procedure Process_Project_Tree_Phase_2 - (In_Tree : Project_Tree_Ref; - Project : Project_Id; - Success : out Boolean; - From_Project_Node : Project_Node_Id; - From_Project_Node_Tree : Project_Node_Tree_Ref; - Report_Error : Put_Line_Access; - When_No_Sources : Error_Warning := Error; - Current_Dir : String; - Is_Config_File : Boolean; - Compiler_Driver_Mandatory : Boolean; - Allow_Duplicate_Basenames : Boolean) + (In_Tree : Project_Tree_Ref; + Project : Project_Id; + Success : out Boolean; + From_Project_Node : Project_Node_Id; + From_Project_Node_Tree : Project_Node_Tree_Ref; + Report_Error : Put_Line_Access; + When_No_Sources : Error_Warning := Error; + Current_Dir : String; + Require_Sources_Other_Lang : Boolean; + Compiler_Driver_Mandatory : Boolean; + Allow_Duplicate_Basenames : Boolean) is Obj_Dir : Path_Name_Type; Extending : Project_Id; @@ -2341,9 +2338,9 @@ package body Prj.Proc is if Project /= No_Project then Check (In_Tree, Project, Current_Dir, When_No_Sources, - Is_Config_File => Is_Config_File, - Compiler_Driver_Mandatory => Compiler_Driver_Mandatory, - Allow_Duplicate_Basenames => Allow_Duplicate_Basenames); + Require_Sources_Other_Lang => Require_Sources_Other_Lang, + Compiler_Driver_Mandatory => Compiler_Driver_Mandatory, + Allow_Duplicate_Basenames => Allow_Duplicate_Basenames); end if; -- If main project is an extending all project, set the object @@ -2464,12 +2461,7 @@ package body Prj.Proc is Write_Line (""""); end if; - Prj.Nmsc.Check - (Project, Data.In_Tree, Error_Report, Data.When_No_Sources, - Data.Current_Dir.all, Data.Proc_Data, - Compiler_Driver_Mandatory => Data.Compiler_Driver_Mandatory, - Is_Config_File => Data.Is_Config_File, - Allow_Duplicate_Basenames => Data.Allow_Duplicate_Basenames); + Prj.Nmsc.Check (Project, Data.Current_Dir.all, Data.Proc_Data); end Recursive_Check; ----------------------- |