Commit 3d164ffc by Arnaud Charlet

[multiple changes]

2010-06-18  Pascal Obry  <obry@adacore.com>

	* prj-nmsc.adb: Fix source filenames casing in debug output.

2010-06-18  Robert Dewar  <dewar@adacore.com>

	* gnatcmd.adb: Minor reformatting.

From-SVN: r160989
parent 4d777a71
2010-06-18 Pascal Obry <obry@adacore.com>
* prj-nmsc.adb: Fix source filenames casing in debug output.
2010-06-18 Robert Dewar <dewar@adacore.com>
* gnatcmd.adb: Minor reformatting.
2010-06-18 Robert Dewar <dewar@adacore.com> 2010-06-18 Robert Dewar <dewar@adacore.com>
* sem_eval.adb (Eval_Conditional_Expression): Result is static if * sem_eval.adb (Eval_Conditional_Expression): Result is static if
......
...@@ -141,7 +141,7 @@ procedure GNATCmd is ...@@ -141,7 +141,7 @@ procedure GNATCmd is
Packages_To_Check_By_Check : constant String_List_Access := Packages_To_Check_By_Check : constant String_List_Access :=
new String_List' new String_List'
((Naming_String, Builder_String, Check_String, Compiler_String)); ((Naming_String, Builder_String, Check_String, Compiler_String));
Packages_To_Check_By_Sync : constant String_List_Access := Packages_To_Check_By_Sync : constant String_List_Access :=
new String_List'((Naming_String, Synchronize_String, Compiler_String)); new String_List'((Naming_String, Synchronize_String, Compiler_String));
...@@ -335,13 +335,11 @@ procedure GNATCmd is ...@@ -335,13 +335,11 @@ procedure GNATCmd is
if Index = 1 if Index = 1
or else or else
(The_Command = Check (The_Command = Check
and then and then Last_Switches.Table (Index - 1).all /= "-o")
Last_Switches.Table (Index - 1).all /= "-o")
or else or else
(The_Command = Pretty (The_Command = Pretty
and then and then Last_Switches.Table (Index - 1).all /= "-o"
Last_Switches.Table (Index - 1).all /= "-o" and then and then Last_Switches.Table (Index - 1).all /= "-of")
Last_Switches.Table (Index - 1).all /= "-of")
or else or else
(The_Command = Metric (The_Command = Metric
and then and then
...@@ -365,7 +363,7 @@ procedure GNATCmd is ...@@ -365,7 +363,7 @@ procedure GNATCmd is
if Add_Sources then if Add_Sources then
-- For gnatcheck, gnatpp and gnatmetric, create a temporary file -- For gnatcheck, gnatpp, and gnatmetric, create a temporary file
-- and put the list of sources in it. -- and put the list of sources in it.
if The_Command = Check or else if The_Command = Check or else
...@@ -457,8 +455,8 @@ procedure GNATCmd is ...@@ -457,8 +455,8 @@ procedure GNATCmd is
then then
-- There is a body, check if it is for this project -- There is a body, check if it is for this project
if All_Projects or else if All_Projects
Unit.File_Names (Impl).Project = Project or else Unit.File_Names (Impl).Project = Project
then then
Subunit := False; Subunit := False;
...@@ -1085,8 +1083,7 @@ procedure GNATCmd is ...@@ -1085,8 +1083,7 @@ procedure GNATCmd is
-- Append ".ali" if file name does not end with it -- Append ".ali" if file name does not end with it
if Switch'Length <= 4 if Switch'Length <= 4
or else Switch (Switch'Last - 3 .. Switch'Last) or else Switch (Switch'Last - 3 .. Switch'Last) /= ".ali"
/= ".ali"
then then
Last := ALI_File'Last; Last := ALI_File'Last;
end if; end if;
...@@ -1099,8 +1096,8 @@ procedure GNATCmd is ...@@ -1099,8 +1096,8 @@ procedure GNATCmd is
else else
for K in Switch'Range loop for K in Switch'Range loop
if Switch (K) = '/' or else if Switch (K) = '/'
Switch (K) = Directory_Separator or else Switch (K) = Directory_Separator
then then
Test_Existence := True; Test_Existence := True;
exit; exit;
...@@ -1277,7 +1274,7 @@ procedure GNATCmd is ...@@ -1277,7 +1274,7 @@ procedure GNATCmd is
-- No usage for VMS only command or for Sync -- No usage for VMS only command or for Sync
if (not Command_List (C).VMS_Only) and then C /= Sync then if not Command_List (C).VMS_Only and then C /= Sync then
if Targparm.AAMP_On_Target then if Targparm.AAMP_On_Target then
Put ("gnaampcmd "); Put ("gnaampcmd ");
else else
...@@ -1643,11 +1640,12 @@ begin ...@@ -1643,11 +1640,12 @@ begin
-- --subdirs=... Specify Subdirs -- --subdirs=... Specify Subdirs
if Argv'Length > Makeutl.Subdirs_Option'Length and then if Argv'Length > Makeutl.Subdirs_Option'Length
Argv and then
(Argv'First .. Argv
Argv'First + Makeutl.Subdirs_Option'Length - 1) = (Argv'First ..
Makeutl.Subdirs_Option Argv'First + Makeutl.Subdirs_Option'Length - 1) =
Makeutl.Subdirs_Option
then then
Subdirs := Subdirs :=
new String' new String'
...@@ -1756,8 +1754,9 @@ begin ...@@ -1756,8 +1754,9 @@ begin
('=', ('=',
Argv (Argv'First + 2 .. Argv'Last)); Argv (Argv'First + 2 .. Argv'Last));
begin begin
if Equal_Pos >= Argv'First + 3 and then if Equal_Pos >= Argv'First + 3
Equal_Pos /= Argv'Last then and then Equal_Pos /= Argv'Last
then
Add (Project_Node_Tree, Add (Project_Node_Tree,
External_Name => External_Name =>
Argv (Argv'First + 2 .. Equal_Pos - 1), Argv (Argv'First + 2 .. Equal_Pos - 1),
...@@ -1959,7 +1958,7 @@ begin ...@@ -1959,7 +1958,7 @@ begin
end if; end if;
end; end;
if The_Command = Bind if The_Command = Bind
or else The_Command = Link or else The_Command = Link
or else The_Command = Elim or else The_Command = Elim
then then
...@@ -1974,7 +1973,7 @@ begin ...@@ -1974,7 +1973,7 @@ begin
-- For gnatcheck, gnatstub, gnatmetric, gnatpp and gnatelim, create -- For gnatcheck, gnatstub, gnatmetric, gnatpp and gnatelim, create
-- a configuration pragmas file, if necessary. -- a configuration pragmas file, if necessary.
if The_Command = Pretty if The_Command = Pretty
or else The_Command = Metric or else The_Command = Metric
or else The_Command = Stub or else The_Command = Stub
or else The_Command = Elim or else The_Command = Elim
...@@ -2112,7 +2111,7 @@ begin ...@@ -2112,7 +2111,7 @@ begin
while K <= First_Switches.Last while K <= First_Switches.Last
and then and then
(The_Command /= Check (The_Command /= Check
or else First_Switches.Table (K).all /= "-rules") or else First_Switches.Table (K).all /= "-rules")
loop loop
Add_To_Carg_Switches (First_Switches.Table (K)); Add_To_Carg_Switches (First_Switches.Table (K));
K := K + 1; K := K + 1;
...@@ -2152,8 +2151,7 @@ begin ...@@ -2152,8 +2151,7 @@ begin
while K <= Last_Switches.Last while K <= Last_Switches.Last
and then and then
(The_Command /= Check (The_Command /= Check
or else or else Last_Switches.Table (K).all /= "-rules")
Last_Switches.Table (K).all /= "-rules")
loop loop
Add_To_Carg_Switches (Last_Switches.Table (K)); Add_To_Carg_Switches (Last_Switches.Table (K));
K := K + 1; K := K + 1;
...@@ -2207,33 +2205,35 @@ begin ...@@ -2207,33 +2205,35 @@ begin
if The_Command = Check then if The_Command = Check then
declare declare
Pkg : constant Prj.Package_Id := Pkg : constant Prj.Package_Id :=
Prj.Util.Value_Of Prj.Util.Value_Of
(Name => Name_Builder, (Name => Name_Builder,
In_Packages => Project.Decl.Packages, In_Packages => Project.Decl.Packages,
In_Tree => Project_Tree); In_Tree => Project_Tree);
Variable : Variable_Value := Variable : Variable_Value :=
Prj.Util.Value_Of Prj.Util.Value_Of
(Name => No_Name, (Name => No_Name,
Attribute_Or_Array_Name => Attribute_Or_Array_Name =>
Name_Global_Configuration_Pragmas, Name_Global_Configuration_Pragmas,
In_Package => Pkg, In_Package => Pkg,
In_Tree => Project_Tree); In_Tree => Project_Tree);
begin begin
if (Variable = Nil_Variable_Value or else if (Variable = Nil_Variable_Value
Length_Of_Name (Variable.Value) = 0) or else Length_Of_Name (Variable.Value) = 0)
and then Pkg /= No_Package and then Pkg /= No_Package
then then
Variable := Variable :=
Prj.Util.Value_Of Prj.Util.Value_Of
(Name => Name_Ada, (Name => Name_Ada,
Attribute_Or_Array_Name => Name_Global_Config_File, Attribute_Or_Array_Name =>
In_Package => Pkg, Name_Global_Config_File,
In_Tree => Project_Tree); In_Package => Pkg,
In_Tree => Project_Tree);
end if; end if;
if Variable /= Nil_Variable_Value and then if Variable /= Nil_Variable_Value
Length_Of_Name (Variable.Value) /= 0 and then Length_Of_Name (Variable.Value) /= 0
then then
Add_To_Carg_Switches Add_To_Carg_Switches
(new String' (new String'
...@@ -2243,22 +2243,23 @@ begin ...@@ -2243,22 +2243,23 @@ begin
if not All_Projects then if not All_Projects then
declare declare
Pkg : constant Prj.Package_Id := Pkg : constant Prj.Package_Id :=
Prj.Util.Value_Of Prj.Util.Value_Of
(Name => Name_Compiler, (Name => Name_Compiler,
In_Packages => Project.Decl.Packages, In_Packages => Project.Decl.Packages,
In_Tree => Project_Tree); In_Tree => Project_Tree);
Variable : Variable_Value := Variable : Variable_Value :=
Prj.Util.Value_Of Prj.Util.Value_Of
(Name => No_Name, (Name => No_Name,
Attribute_Or_Array_Name => Attribute_Or_Array_Name =>
Name_Local_Configuration_Pragmas, Name_Local_Configuration_Pragmas,
In_Package => Pkg, In_Package => Pkg,
In_Tree => Project_Tree); In_Tree => Project_Tree);
begin begin
if (Variable = Nil_Variable_Value or else if (Variable = Nil_Variable_Value
Length_Of_Name (Variable.Value) = 0) or else Length_Of_Name (Variable.Value) = 0)
and then Pkg /= No_Package and then Pkg /= No_Package
then then
Variable := Variable :=
...@@ -2270,8 +2271,8 @@ begin ...@@ -2270,8 +2271,8 @@ begin
In_Tree => Project_Tree); In_Tree => Project_Tree);
end if; end if;
if Variable /= Nil_Variable_Value and then if Variable /= Nil_Variable_Value
Length_Of_Name (Variable.Value) /= 0 and then Length_Of_Name (Variable.Value) /= 0
then then
Add_To_Carg_Switches Add_To_Carg_Switches
(new String' (new String'
......
...@@ -6888,31 +6888,29 @@ package body Prj.Nmsc is ...@@ -6888,31 +6888,29 @@ package body Prj.Nmsc is
end if; end if;
declare declare
Path_Name : constant String := Path_Name : constant String :=
Normalize_Pathname Normalize_Pathname
(Name (1 .. Last), (Name (1 .. Last),
Directory => Directory =>
Source_Directory Source_Directory
(Source_Directory'First .. (Source_Directory'First ..
Dir_Last), Dir_Last),
Resolve_Links => Resolve_Links =>
Opt.Follow_Links_For_Files, Opt.Follow_Links_For_Files,
Case_Sensitive => True); Case_Sensitive => True);
Path : Path_Name_Type; Path : Path_Name_Type;
Display_Path : Path_Name_Type; FF : File_Found :=
FF : File_Found := Excluded_Sources_Htable.Get
Excluded_Sources_Htable.Get (Project.Excluded, File_Name);
(Project.Excluded, File_Name); To_Remove : Boolean := False;
To_Remove : Boolean := False;
begin begin
Name_Len := Path_Name'Length; Name_Len := Path_Name'Length;
Name_Buffer (1 .. Name_Len) := Path_Name; Name_Buffer (1 .. Name_Len) := Path_Name;
Display_Path := Name_Find;
if Osint.File_Names_Case_Sensitive then if Osint.File_Names_Case_Sensitive then
Path := Display_Path; Path := Name_Find;
else else
Canonical_Case_File_Name Canonical_Case_File_Name
(Name_Buffer (1 .. Name_Len)); (Name_Buffer (1 .. Name_Len));
...@@ -6927,7 +6925,8 @@ package body Prj.Nmsc is ...@@ -6927,7 +6925,8 @@ package body Prj.Nmsc is
if Current_Verbosity = High then if Current_Verbosity = High then
Write_Str (" excluded source """); Write_Str (" excluded source """);
Write_Str (Get_Name_String (File_Name)); Write_Str
(Get_Name_String (Display_File_Name));
Write_Line (""""); Write_Line ("""");
end if; end if;
...@@ -6954,7 +6953,7 @@ package body Prj.Nmsc is ...@@ -6954,7 +6953,7 @@ package body Prj.Nmsc is
Source_Dir_Rank => Num_Nod.Number, Source_Dir_Rank => Num_Nod.Number,
Data => Data, Data => Data,
Path => Path, Path => Path,
Display_Path => Display_Path, Display_Path => Name_Find,
File_Name => File_Name, File_Name => File_Name,
Locally_Removed => To_Remove, Locally_Removed => To_Remove,
Display_File_Name => Display_File_Name, Display_File_Name => Display_File_Name,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment