diff options
author | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-08-04 15:31:56 +0000 |
---|---|---|
committer | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-08-04 15:31:56 +0000 |
commit | 9eb919116e4eba4b38519ee961ebfa9bc3ac32cc (patch) | |
tree | 221b324fc246557794e1977bd63dc7c19d564aa1 /gcc/ada/gnatls.adb | |
parent | fe9fc6757e47fecf2bb25f018c0e0297370638d8 (diff) | |
download | ppe42-gcc-9eb919116e4eba4b38519ee961ebfa9bc3ac32cc.tar.gz ppe42-gcc-9eb919116e4eba4b38519ee961ebfa9bc3ac32cc.zip |
2011-08-04 Thomas Quinot <quinot@adacore.com>
* gnatls.adb: Use Prj.Env.Initialize_Default_Project_Path to retrieve
the project path.
2011-08-04 Robert Dewar <dewar@adacore.com>
* a-coinho.adb: Minor reformatting.
2011-08-04 Robert Dewar <dewar@adacore.com>
* a-coinho.ads: Minor reformatting.
2011-08-04 Vadim Godunko <godunko@adacore.com>
* s-atocou.ads, s-atocou.adb: New files.
* a-strunb-shared.ads, a-strunb-shared.adb, a-stwiun-shared.ads,
a-stwiun-shared.adb, a-stzunb-shared.ads, a-stzunb-shared.adb: Remove
direct use of GCC's atomic builtins and replace them by use of new
atomic counter package.
2011-08-04 Ed Schonberg <schonberg@adacore.com>
* exp_strm.adb: better error message for No_Default_Stream_Attributes.
2011-08-04 Hristian Kirtchev <kirtchev@adacore.com>
* a-tags.adb (Unregister_Tag): Replace the complex address arithmetic
with a call to Get_External_Tag.
* exp_ch7.adb (Build_Cleanup_Statements): Update the comment on
subprogram usage. Remove the guard against package declarations and
bodies since Build_Cleanup_Statements is no longer invoked in that
context.
(Build_Components): Initialize Tagged_Type_Stmts when the context
contains at least one library-level tagged type.
(Build_Finalizer): New local variables Has_Tagged_Types and
Tagged_Type_Stmts along with associated comments on usage. Update the
logic to include tagged type processing.
(Create_Finalizer): Insert all library-level tagged type unregistration
code before the jump block circuitry.
(Expand_N_Package_Body): Remove the call to Build_Cleanup_Statements.
(Expand_N_Package_Declaration): Remove the call to
Build_Cleanup_Statements.
(Process_Tagged_Type_Declaration): New routine. Generate a call to
unregister the external tag of a tagged type.
(Processing_Actions): Reimplemented to handle tagged types.
(Process_Declarations): Detect the declaration of a library-level
tagged type and carry out the appropriate actions.
(Unregister_Tagged_Types): Removed. The machinery has been directly
merged with Build_Finalizer.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@177401 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/gnatls.adb')
-rw-r--r-- | gcc/ada/gnatls.adb | 106 |
1 files changed, 13 insertions, 93 deletions
diff --git a/gcc/ada/gnatls.adb b/gcc/ada/gnatls.adb index a2612861c08..f7f4ddb45fe 100644 --- a/gcc/ada/gnatls.adb +++ b/gcc/ada/gnatls.adb @@ -36,6 +36,7 @@ with Opt; use Opt; with Osint; use Osint; with Osint.L; use Osint.L; with Output; use Output; +with Prj.Env; use Prj.Env; with Rident; use Rident; with Sdefault; with Snames; @@ -47,12 +48,6 @@ with GNAT.Case_Util; use GNAT.Case_Util; procedure Gnatls is pragma Ident (Gnat_Static_Version_String); - Gpr_Project_Path : constant String := "GPR_PROJECT_PATH"; - Ada_Project_Path : constant String := "ADA_PROJECT_PATH"; - -- Names of the env. variables that contains path name(s) of directories - -- where project files may reside. If GPR_PROJECT_PATH is defined, its - -- value is used, otherwise ADA_PROJECT_PATH is used, if defined. - -- NOTE : The following string may be used by other tools, such as GPS. So -- it can only be modified if these other uses are checked and coordinated. @@ -60,7 +55,7 @@ procedure Gnatls is -- Label displayed in verbose mode before the directories in the project -- search path. Do not modify without checking NOTE above. - No_Project_Default_Dir : constant String := "-"; + Prj_Path : Prj.Env.Project_Search_Path; Max_Column : constant := 80; @@ -223,7 +218,7 @@ procedure Gnatls is end if; end Add_Lib_Dir; - -- ----------------- + -------------------- -- Add_Source_Dir -- -------------------- @@ -1614,27 +1609,16 @@ begin Write_Str (" <Current_Directory>"); Write_Eol; - -- The code below reproduces Prj.Env.Initialize_Default_Project_Path, - -- shouldn't we reuse that instead??? + Initialize_Default_Project_Path + (Prj_Path, Target_Name => Sdefault.Target_Name.all); declare - Project_Path : String_Access := Getenv (Gpr_Project_Path); - - Lib : constant String := - Directory_Separator & "lib" & Directory_Separator; - - First : Natural; - Last : Natural; - - Add_Default_Dir : Boolean := True; - Prefix_Name_Len : Integer; + Project_Path : String_Access; + First : Natural; + Last : Natural; begin - -- If there is a project path, display each directory in the path - - if Project_Path.all = "" then - Project_Path := Getenv (Ada_Project_Path); - end if; + Get_Path (Prj_Path, Project_Path); if Project_Path.all /= "" then First := Project_Path'First; @@ -1654,13 +1638,7 @@ begin Last := Last + 1; end loop; - -- If the directory is No_Default_Project_Dir, set - -- Add_Default_Dir to False. - - if Project_Path (First .. Last) = No_Project_Default_Dir then - Add_Default_Dir := False; - - elsif First /= Last or else Project_Path (First) /= '.' then + if First /= Last or else Project_Path (First) /= '.' then -- If the directory is ".", skip it as it is the current -- directory and it is already the first directory in the @@ -1668,73 +1646,15 @@ begin Write_Str (" "); Write_Str - (To_Host_Dir_Spec - (Project_Path (First .. Last), True).all); + (Normalize_Pathname + (To_Host_Dir_Spec + (Project_Path (First .. Last), True).all)); Write_Eol; end if; First := Last + 1; end loop; end if; - - -- Add the default dir, except if "-" was one of the "directories" - -- specified in ADA_PROJECT_DIR. - - if Add_Default_Dir then - Name_Len := 0; - Add_Str_To_Name_Buffer (Sdefault.Search_Dir_Prefix.all); - - -- On Windows, make sure that all directory separators are '\' - - if Directory_Separator /= '/' then - for J in 1 .. Name_Len loop - if Name_Buffer (J) = '/' then - Name_Buffer (J) := Directory_Separator; - end if; - end loop; - end if; - - -- Find the sequence "/lib/" - - while Name_Len >= Lib'Length - and then Name_Buffer (Name_Len - 4 .. Name_Len) /= Lib - loop - Name_Len := Name_Len - 1; - end loop; - - -- If the sequence "/lib"/ was found, display the default - -- directories <prefix>/<target>/lib/gnat and <prefix>/lib/gnat/. - - if Name_Len >= 5 then - Prefix_Name_Len := Name_Len - 4; - - Name_Len := Prefix_Name_Len; - - Name_Len := Prefix_Name_Len; - Add_Str_To_Name_Buffer (Sdefault.Target_Name.all); - Name_Len := Name_Len - 1; - Add_Str_To_Name_Buffer (Directory_Separator - & "lib" & Directory_Separator - & "gnat" & Directory_Separator); - Write_Str (" "); - Write_Line - (To_Host_Dir_Spec (Name_Buffer (1 .. Name_Len), True).all); - - Name_Len := Prefix_Name_Len; - Add_Str_To_Name_Buffer ("share" & Directory_Separator - & "gpr" & Directory_Separator); - Write_Str (" "); - Write_Line - (To_Host_Dir_Spec (Name_Buffer (1 .. Name_Len), True).all); - - Name_Len := Prefix_Name_Len; - Add_Str_To_Name_Buffer ("lib" & Directory_Separator - & "gnat" & Directory_Separator); - Write_Str (" "); - Write_Line - (To_Host_Dir_Spec (Name_Buffer (1 .. Name_Len), True).all); - end if; - end if; end; Write_Eol; |