prj.ads, prj.adb (Is_A_Language): Now takes a Name_Id instead of a string
authorEmmanuel Briot <briot@adacore.com>
Thu, 13 Dec 2007 10:28:39 +0000 (11:28 +0100)
committerArnaud Charlet <charlet@gcc.gnu.org>
Thu, 13 Dec 2007 10:28:39 +0000 (11:28 +0100)
commit6c1f47ee4b24ebae655517ad3ea934856aae662d
treef34d6aa77881e7af268ea3a8628eb9fef5c872a7
parent800621e062382ae60c7416a2c24544d566d0f3b8
prj.ads, prj.adb (Is_A_Language): Now takes a Name_Id instead of a string

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

From-SVN: r130846
15 files changed:
gcc/ada/prj-attr.adb
gcc/ada/prj-dect.adb
gcc/ada/prj-env.adb
gcc/ada/prj-ext.adb
gcc/ada/prj-makr.adb
gcc/ada/prj-nmsc.adb
gcc/ada/prj-nmsc.ads
gcc/ada/prj-pars.adb
gcc/ada/prj-part.adb
gcc/ada/prj-part.ads
gcc/ada/prj-proc.adb
gcc/ada/prj-proc.ads
gcc/ada/prj.adb
gcc/ada/prj.ads
gcc/ada/switch-m.adb