summaryrefslogtreecommitdiff
path: root/gcc/ada/prj-part.ads
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-part.ads
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-part.ads')
-rw-r--r--gcc/ada/prj-part.ads9
1 files changed, 7 insertions, 2 deletions
diff --git a/gcc/ada/prj-part.ads b/gcc/ada/prj-part.ads
index 91e57e0af20..8e366bc4fff 100644
--- a/gcc/ada/prj-part.ads
+++ b/gcc/ada/prj-part.ads
@@ -35,7 +35,8 @@ package Prj.Part is
Project_File_Name : String;
Always_Errout_Finalize : Boolean;
Packages_To_Check : String_List_Access := All_Packages;
- Store_Comments : Boolean := False);
+ Store_Comments : Boolean := False;
+ Current_Directory : String := "");
-- Parse project file and all its imported project files and create a tree.
-- Return the node for the project (or Empty_Node if parsing failed). If
-- Always_Errout_Finalize is True, Errout.Finalize is called in all cases,
@@ -44,6 +45,9 @@ package Prj.Part is
-- where any unknown attribute produces an error. For other packages, an
-- unknown attribute produces a warning. When Store_Comments is True,
-- comments are stored in the parse tree.
+ --
+ -- Current_Directory is used for optimization purposes only, avoiding extra
+ -- system calls.
type Extension_Origin is (None, Extending_Simple, Extending_All);
-- Type of parameter From_Extended for procedures Parse_Single_Project and
@@ -59,7 +63,8 @@ package Prj.Part is
From_Extended : Extension_Origin;
In_Limited : Boolean;
Packages_To_Check : String_List_Access;
- Depth : Natural);
+ Depth : Natural;
+ Current_Dir : String);
-- Parse a project file.
-- Recursive procedure: it calls itself for imported and extended
-- projects. When From_Extended is not None, if the project has already