summaryrefslogtreecommitdiff
path: root/gcc/ada/prj-pars.adb
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2007-12-13 10:28:39 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2007-12-13 10:28:39 +0000
commite7084ad5a3335a2812b9f430ed3cb1c8464cf7aa (patch)
treef34d6aa77881e7af268ea3a8628eb9fef5c872a7 /gcc/ada/prj-pars.adb
parent3062c401ad2c0af8f48d4e22b9feea8043baef45 (diff)
downloadgcc-e7084ad5a3335a2812b9f430ed3cb1c8464cf7aa.tar.gz
2007-12-06 Emmanuel Briot <briot@adacore.com>
Vincent Celier <celier@adacore.com> * prj.ads, prj.adb (Is_A_Language): Now takes a Name_Id instead of a string (Must_Check_Configuration, Default_Language_Is_Ada): new flags in prj.ads (Hash): Move instantiation of System.HTable.Hash from spec to body (prj-nmsc.adb): Optimize calls to Name_Find when on case sensitive systems, since we do not need to recompute the Name_Id for the canonical file name. (Body_Suffix_Id_Of, Spec_Suffix_Id_Of): new version that takes a name_id as a parameter. This parameter is in fact always "ada" in all calls, and we were doing 160560 extra calls to Name_Find to convert it to Name_Ada while loading a project with 40000 files * prj-attr.adb: Fix name of attribute Dependency_Driver Change the kind of indexing for attribute Root * prj-dect.adb (Parse_Declarative_Items): Allow redeclarations of variables already declared, in case constructions. * prj-env.adb (Initialize): Reset Current_Source_Path_File and Current_Object_Path_File to No_Path. * prj-ext.adb (Initialize_Project_Path): In multi language mode, use ADA_PROJECT_PATH if value of GPR_PROJECT_PATH is empty. * prj-makr.adb: new parameter Current_Dir * prj-nmsc.ads, prj-nmsc.adb (Find_Explicit_Sources): Do not look for Ada sources when language is not Ada. Change Opt.Follow_Links to Opt.Follow_Links_For_Files. (Find_Excluded_Sources, Find_Explicit_Sources): new subprograms (Must_Check_Configuration, Default_Language_Is_Ada): new flags. (Locate_Directory): Always resolve links when computing Canonical_Path (Look_For_Sources): Make sure that Name_Buffer contains the file name in Source_Files before checking for the presence of a directory separator. Optimize calls to Name_Find when on case sensitive systems. (Body_Suffix_Id_Of, Spec_Suffix_Id_Of): new version that takes a name_id as a parameter. (Prj.Nmsc.Check): new parameter Current_Dir (Check_Ada_Naming_Schemes): Restrictions on suffixes are relaxed. They cannot be empty and the spec suffix cannot be the same as the body or separate suffix. (Get_Unit): When a file name can be of several unit kinds (spec, body or subunit), always consider the longest suffix. (Check_Configuration): Do not issue an error if there is no compiler for a language. Just issue a warning and ignore the sources for the language. (Check_Library_Attributes): Only check Library_Dir if Library_Name is not empty. (Check_Naming_Schemes.Maked_Unit): Only output message if high verbosity (Unit_Exceptions): New hash table (Check_Naming_Schemes): Check if a file that could be a unit because of the naming scheme is not in fact a source because there is an exception for the unit. (Look_For_Sources): Put the unit exceptions in hash table Unit_Exceptions (Get_Unit_Exceptions): Give initial value No_Source to local variable Other_Part to avoid exception when code is compiled with validity checking. (Get_Sources_From_File): Check that there is no directory information in the file names. (Look_For_Sources): Check that there is no directory information in the list of file names in Source_Files. (Look_For_Sources): In multi-language mode, do not allow exception file names that are excluded. (Excluded_Sources_Htable): New hash table (Search_Directories.Check_File): New procedure to simplify Search_Directories. (Search_Directories): Do not consider excluded sources (Look_For_Sources): Populate Excluded_Sources_Htable before calling Search_Directories. (Get_Exceptions): Set component Lang_Kind of Source_Data (Get_Unit_Exceptions): Ditto (Search_Directories): Ditto * prj-pars.adb: new parameter Current_Dir * prj-part.ads, prj-part.adb: Change Opt.Follow_Links to Opt.Follow_Links_For_Files. (Opt.Follow_Links_For_Dirs): New flag (Project_Path_Name_Of): Cache information returned by this routine as Locate_Regular_File is a costly routine. The code to output a log information and the effective call to Locate_Regular_File is now factorized into a routine (code clean-up). (Parse, Parse_Single_Project): new parameter Current_Dir When main project file cannot be found, indicate in the error message the project path that was used to do the search. * prj-proc.ads, prj-proc.adb (Opt.Follow_Links_For_Dirs): New flag (Prj.Proc.Process*): new parameter Current_Dir * switch-m.adb: Change Opt.Follow_Links to Opt.Follow_Links_For_Files git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@130846 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/prj-pars.adb')
-rw-r--r--gcc/ada/prj-pars.adb10
1 files changed, 6 insertions, 4 deletions
diff --git a/gcc/ada/prj-pars.adb b/gcc/ada/prj-pars.adb
index 7a46de58dae..fb277b4bc0f 100644
--- a/gcc/ada/prj-pars.adb
+++ b/gcc/ada/prj-pars.adb
@@ -24,8 +24,8 @@
------------------------------------------------------------------------------
with Ada.Exceptions; use Ada.Exceptions;
+with GNAT.Directory_Operations; use GNAT.Directory_Operations;
-with Opt;
with Output; use Output;
with Prj.Err; use Prj.Err;
with Prj.Part;
@@ -52,6 +52,7 @@ package body Prj.Pars is
Project_Node : Project_Node_Id := Empty_Node;
The_Project : Project_Id := No_Project;
Success : Boolean := True;
+ Current_Dir : constant String := Get_Current_Dir;
begin
Prj.Tree.Initialize (Project_Node_Tree);
@@ -64,7 +65,8 @@ package body Prj.Pars is
Project => Project_Node,
Project_File_Name => Project_File_Name,
Always_Errout_Finalize => False,
- Packages_To_Check => Packages_To_Check);
+ Packages_To_Check => Packages_To_Check,
+ Current_Directory => Current_Dir);
-- If there were no error, process the tree
@@ -76,9 +78,9 @@ package body Prj.Pars is
From_Project_Node => Project_Node,
From_Project_Node_Tree => Project_Node_Tree,
Report_Error => null,
- Follow_Links => Opt.Follow_Links,
When_No_Sources => When_No_Sources,
- Reset_Tree => Reset_Tree);
+ Reset_Tree => Reset_Tree,
+ Current_Dir => Current_Dir);
Prj.Err.Finalize;
if not Success then