diff options
author | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-12-08 11:25:51 +0000 |
---|---|---|
committer | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-12-08 11:25:51 +0000 |
commit | 9080eb6bba3613f90aa8b0444a4eb07a4eda3a9d (patch) | |
tree | 5f264e895f21f42a7c2b643a609e2b267faf6e7e /gcc/ada/prj-proc.adb | |
parent | abc1c7367f2daa619b80129dd927520829f81364 (diff) | |
download | gcc-9080eb6bba3613f90aa8b0444a4eb07a4eda3a9d.tar.gz |
* make.adb (Check_Mains, Switches_Of): Adapt to name changes in
package Prj (Current_Spec_Suffix => Ada_Spec_Suffix,
Current_Body_Suffix => Ada_Body_Suffix).
Take into account Externally_Built attribute.
* clean.adb (In_Extension_Chain): Always return False when one of the
parameter is No_Project.
(Clean_Project): Adapt to changes in package Prj (Lang_Ada =>
Ada_Language_Index).
(Gnatclean): Adapt to change in package Prj.Pars (no parameter
Process_Languages for procedure Parse).
* gnatcmd.adb (Carg_Switches): New table.
(GNATCmd): Put all switches following -cargs in the Carg_Switches table.
Adapt to name changes in package Prj (Current_Spec_Suffix =>
Ada_Spec_Suffix, Current_Body_Suffix => Ada_Body_Suffix).
* mlib-prj.adb: Adapt to changes in packages Prj and Prj.Com: type
Header_Num and function Hash are now declared in package Prj,
not Prj.Com.
* prj.adb (Suffix_Of): New function.
(Set (Suffix)): New procedure.
(Hash): One function moved from Prj.Com
(Is_Present, Language_Processing_Data_Of): New functions
(Set): Two new procedures
(Add_Language_Name, Display_Language_Name): New procedures
* prj.ads: (Suffix_Of): New function
(Set (Suffix)): New procedure
Add several types and tables for multi-language support.
(Header_Num): Type moved from Prj.Com
(Hash): Two functions moved from Prj.Com
(Is_Present, Language_Processing_Data_Of): New functions
(Set): Two new procedures
(Add_Language_Name, Display_Language_Name): New procedures
(Naming): Component name changes:
Current_Spec_Suffix => Ada_Spec_Suffix,
Current_Body_Suffix => Ada_Body_Suffix. Add new components:
Impl_Suffixes, Supp_Suffixes.
(Project_Data): New components: Externally_Built, Supp_Languages,
First_Language_Processing, Supp_Language_Processing, Default_Linker,
Default_Linker_Path.
* prj-attr.adb: Add new attributes Ada_Roots and Externally_Built and
new package Language_Processing with its attributes (Compiler_Driver,
Compiler_Kind, Dependency_Option, Compute_Dependency, Include_Option,
Binder_Driver, Default_Linker).
* prj-com.ads, prj-com.adb (Hash): Function moved to package Prj.
(Header_Num): Type moved to package Prj
* prj-env.adb: Adapt to name changes in package Prj
(Current_Spec_Suffix => Ada_Spec_Suffix,
Current_Body_Suffix => Ada_Body_Suffix).
* prj-ext.adb: Add the default project dir (<prefix>/log/gnat) by
default to the project path, except the "-" is one of the directories
in env var ADA_PROJECT_PATH.
(Current_Project_Path): Global variable, replacing Project_Path
that was in the body of Prj.Part.
(Project_Path): New function
(Set_Project_Path): New procedure
Initialize Current_Project_Path during elaboration of the package
Remove dependency on Prj.Com, no longer needed
* prj-ext.ads (Project_Path): New function
(Set_Project_Path): New procedure
* prj-nmsc.adb (Body_Suffix_Of): New function. Returns .<lang> when no
suffix is defined for language <lang>.
(Find_Sources, Record_Other_Sources): Use Body_Suffix_Of, instead of
accessing directly the components of Naming.
(Look_For_Sources): Use Set (Suffix) to set the suffix of a language.
Reorganise of this package.
Break procedure Check in several procedures.
* prj-nmsc.ads: Replace all procedures (Ada_Check,
Other_Languages_Check and Language_Independent_Check) with a single
procedure Check.
* prj-pars.ads, prj-pars.adb (Parse): Remove parameter
Process_Languages, no longer needed.
* prj-part.adb (Project_Path): Move to the body of Prj.Ext as
Current_Project_Path.
Remove elaboration code, moved to the body of Prj.Ext
Use new function Prj.Ext.Project_Path instead of old variable
Project_Path.
(Post_Parse_Context_Clause): Get Resolved_Path as a case-sensitive path.
When comparing with project paths on the stack, first put the resolved
path in canonical case.
(Parse_Single_Project): Set the path name of the project file in the
tree to the normalized path.
* prj-proc.ads, prj-proc.adb (Check, Recursive_Check, Process): Remove
parameter Process_Languages, no longer needed.
(Recursive_Check): Call Prj.Nmsc.Check, instead of Ada_Check and
Other_Languages_Check.
* prj-tree.ads (Project_Name_And_Node): New component Canonical_Path
to store the resolved canonical path of the project file.
Remove dependency to Prj.Com, no longer needed
* prj-util.adb: Adapt to name changes in package Prj
(Current_Spec_Suffix => Ada_Spec_Suffix, Current_Body_Suffix =>
Ada_Body_Suffix).
* snames.ads, snames.adb: New standard names: Ada_Roots, Binder_Driver,
Compiler_Driver, Compiler_Kind, Compute_Dependency, Default_Linker,
Externally_Built, Include_Option, Language_Processing.
* makegpr.adb: Numerous changes due to changes in packages
Prj and Prj.Nmsc.
* gnatls.adb: Add the default project dir (<prefix>/log/gnat) by
default to the project path, except whe "-" is one of the directories
in env var ADA_PROJECT_PATH.
(Gnatls): In verbose mode, add the new section "Project Search Path:"
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@91877 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/prj-proc.adb')
-rw-r--r-- | gcc/ada/prj-proc.adb | 77 |
1 files changed, 32 insertions, 45 deletions
diff --git a/gcc/ada/prj-proc.adb b/gcc/ada/prj-proc.adb index 561c5d43809..7adcd08dac7 100644 --- a/gcc/ada/prj-proc.adb +++ b/gcc/ada/prj-proc.adb @@ -30,7 +30,6 @@ with Opt; with Osint; use Osint; with Output; use Output; with Prj.Attr; use Prj.Attr; -with Prj.Com; use Prj.Com; with Prj.Err; use Prj.Err; with Prj.Ext; use Prj.Ext; with Prj.Nmsc; use Prj.Nmsc; @@ -64,12 +63,10 @@ package body Prj.Proc is -- values to the package or project with declarations Decl. procedure Check - (Project : in out Project_Id; - Process_Languages : Languages_Processed; - Follow_Links : Boolean); + (Project : in out Project_Id; + Follow_Links : 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. - -- See Prj.Nmsc.Ada_Check for information on Follow_Links. function Expression (Project : Project_Id; @@ -111,13 +108,11 @@ package body Prj.Proc is -- Then process the declarative items of the project. procedure Recursive_Check - (Project : Project_Id; - Process_Languages : Languages_Processed; - Follow_Links : Boolean); + (Project : Project_Id; + Follow_Links : Boolean); -- If Project is not marked as checked, mark it as checked, call -- Check_Naming_Scheme for the project, then call itself for a -- possible extended project and all the imported projects of Project. - -- See Prj.Nmsc.Ada_Check for information on Follow_Links --------- -- Add -- @@ -127,7 +122,7 @@ package body Prj.Proc is begin if To_Exp = Types.No_Name or else To_Exp = Empty_String then - -- To_Exp is nil or empty. The result is Str. + -- To_Exp is nil or empty. The result is Str To_Exp := Str; @@ -213,9 +208,9 @@ package body Prj.Proc is ----------- procedure Check - (Project : in out Project_Id; - Process_Languages : Languages_Processed; - Follow_Links : Boolean) is + (Project : in out Project_Id; + Follow_Links : Boolean) + is begin -- Make sure that all projects are marked as not checked @@ -223,8 +218,7 @@ package body Prj.Proc is Projects.Table (Index).Checked := False; end loop; - Recursive_Check (Project, Process_Languages, Follow_Links); - + Recursive_Check (Project, Follow_Links); end Check; ---------------- @@ -248,7 +242,7 @@ package body Prj.Proc is -- The returned result Last : String_List_Id := Nil_String; - -- Reference to the last string elements in Result, when Kind is List. + -- Reference to the last string elements in Result, when Kind is List begin Result.Project := Project; @@ -282,8 +276,7 @@ package body Prj.Proc is if Last = Nil_String then - -- This can happen in an expression such as - -- () & "toto" + -- This can happen in an expression like () & "toto" Result.Values := String_Elements.Last; @@ -300,7 +293,6 @@ package body Prj.Proc is Location => Location_Of (The_Current_Term), Flag => False, Next => Nil_String); - end case; when N_Literal_String_List => @@ -856,7 +848,6 @@ package body Prj.Proc is Success : out Boolean; From_Project_Node : Project_Node_Id; Report_Error : Put_Line_Access; - Process_Languages : Languages_Processed := Ada_Language; Follow_Links : Boolean := True) is Obj_Dir : Name_Id; @@ -881,7 +872,7 @@ package body Prj.Proc is Extended_By => No_Project); if Project /= No_Project then - Check (Project, Process_Languages, Follow_Links); + Check (Project, Follow_Links); end if; -- If main project is an extending all project, set the object @@ -922,15 +913,20 @@ package body Prj.Proc is Extending2 := Extending; while Extending2 /= No_Project loop - if ((Process_Languages = Ada_Language - and then - Projects.Table (Extending2).Ada_Sources_Present) - or else - (Process_Languages = Other_Languages - and then - Projects.Table (Extending2).Other_Sources_Present)) + +-- why is this code commented out ??? + +-- if ((Process_Languages = Ada_Language +-- and then +-- Projects.Table (Extending2).Ada_Sources_Present) +-- or else +-- (Process_Languages = Other_Languages +-- and then +-- Projects.Table (Extending2).Other_Sources_Present)) + + if Projects.Table (Extending2).Ada_Sources_Present and then - Projects.Table (Extending2).Object_Directory = Obj_Dir + Projects.Table (Extending2).Object_Directory = Obj_Dir then if Projects.Table (Extending2).Virtual then Error_Msg_Name_1 := Projects.Table (Proj).Name; @@ -1267,9 +1263,11 @@ package body Prj.Proc is -- Copy each array element while Orig_Element /= No_Array_Element loop - -- If it is the first element ... + + -- Case of first element if Prev_Element = No_Array_Element then + -- And there is no array element declared yet, -- create a new first array element. @@ -1324,6 +1322,7 @@ package body Prj.Proc is Prev_Element := New_Element; -- Go to the next element in the original array + Orig_Element := Array_Elements.Table (Orig_Element).Next; end loop; @@ -1804,7 +1803,6 @@ package body Prj.Proc is procedure Recursive_Check (Project : Project_Id; - Process_Languages : Languages_Processed; Follow_Links : Boolean) is Data : Project_Data; @@ -1827,7 +1825,7 @@ package body Prj.Proc is -- Call itself for a possible extended project. -- (if there is no extended project, then nothing happens). - Recursive_Check (Data.Extends, Process_Languages, Follow_Links); + Recursive_Check (Data.Extends, Follow_Links); -- Call itself for all imported projects @@ -1835,7 +1833,7 @@ package body Prj.Proc is while Imported_Project_List /= Empty_Project_List loop Recursive_Check (Project_Lists.Table (Imported_Project_List).Project, - Process_Languages, Follow_Links); + Follow_Links); Imported_Project_List := Project_Lists.Table (Imported_Project_List).Next; end loop; @@ -1846,18 +1844,7 @@ package body Prj.Proc is Write_Line (""""); end if; - case Process_Languages is - when Ada_Language => - Prj.Nmsc.Ada_Check (Project, Error_Report, Follow_Links); - - when Other_Languages => - Prj.Nmsc.Other_Languages_Check (Project, Error_Report); - - when All_Languages => - Prj.Nmsc.Ada_Check (Project, Error_Report, Follow_Links); - Prj.Nmsc.Other_Languages_Check (Project, Error_Report); - - end case; + Prj.Nmsc.Check (Project, Error_Report, Follow_Links); end if; end Recursive_Check; |