Commit 3fc5d116 by Robert Dewar Committed by Arnaud Charlet

exp_ch9.adb, [...]: Minor reformatting

2009-09-17  Robert Dewar  <dewar@adacore.com>

	* exp_ch9.adb, exp_ch5.adb, exp_ch4.adb, prj-conf.adb, prj-env.ads,
	prj-ext.adb: Minor reformatting

From-SVN: r151796
parent 1c6b973a
2009-09-17 Robert Dewar <dewar@adacore.com>
* exp_ch9.adb, exp_ch5.adb, exp_ch4.adb, prj-conf.adb, prj-env.ads,
prj-ext.adb: Minor reformatting
2009-09-17 Emmanuel Briot <briot@adacore.com> 2009-09-17 Emmanuel Briot <briot@adacore.com>
* prj-conf.adb, prj-env.adb, prj-env.ads (Create_Temp_File): Moved to * prj-conf.adb, prj-env.adb, prj-env.ads (Create_Temp_File): Moved to
......
...@@ -4134,16 +4134,15 @@ package body Exp_Ch4 is ...@@ -4134,16 +4134,15 @@ package body Exp_Ch4 is
New_N := New_Occurrence_Of (Cnn, Loc); New_N := New_Occurrence_Of (Cnn, Loc);
else else
-- No expansion needed, gigi handles it like a C conditional -- No expansion needed, gigi handles it like a C conditional
-- expression. -- expression.
return; return;
end if; end if;
-- Move the SLOC of the parent If statement to the newly created one -- Move the SLOC of the parent If statement to the newly created one and
-- and change it to the SLOC of the expression which, after -- change it to the SLOC of the expression which, after expansion, will
-- expansion, will correspond to what is being evaluated. -- correspond to what is being evaluated.
if Present (Parent (N)) if Present (Parent (N))
and then Nkind (Parent (N)) = N_If_Statement and then Nkind (Parent (N)) = N_If_Statement
...@@ -4152,6 +4151,9 @@ package body Exp_Ch4 is ...@@ -4152,6 +4151,9 @@ package body Exp_Ch4 is
Set_Sloc (Parent (N), Loc); Set_Sloc (Parent (N), Loc);
end if; end if;
-- Make sure Then_Actions and Else_Actions are appropriately moved
-- to the new if statement.
if Present (Then_Actions (N)) then if Present (Then_Actions (N)) then
Insert_List_Before Insert_List_Before
(First (Then_Statements (New_If)), Then_Actions (N)); (First (Then_Statements (New_If)), Then_Actions (N));
......
...@@ -3142,8 +3142,8 @@ package body Exp_Ch5 is ...@@ -3142,8 +3142,8 @@ package body Exp_Ch5 is
-- Second, we deal with the obvious rewriting for the cases where the -- Second, we deal with the obvious rewriting for the cases where the
-- condition of the IF is known at compile time to be True or False. -- condition of the IF is known at compile time to be True or False.
-- Third, we remove elsif parts which have non-empty Condition_Actions -- Third, we remove elsif parts which have non-empty Condition_Actions and
-- and rewrite as independent if statements. For example: -- rewrite as independent if statements. For example:
-- if x then xs -- if x then xs
-- elsif y then ys -- elsif y then ys
......
...@@ -835,8 +835,8 @@ package body Exp_Ch9 is ...@@ -835,8 +835,8 @@ package body Exp_Ch9 is
end loop; end loop;
-- If we are in a package body, the activation chain variable is -- If we are in a package body, the activation chain variable is
-- declared in the body, but the Activation_Chain_Entity is attached to -- declared in the body, but the Activation_Chain_Entity is attached
-- the spec. -- to the spec.
if Nkind (P) = N_Package_Body then if Nkind (P) = N_Package_Body then
Decls := Declarations (P); Decls := Declarations (P);
......
...@@ -697,6 +697,7 @@ package body Prj.Conf is ...@@ -697,6 +697,7 @@ package body Prj.Conf is
Switches : Argument_List_Access := Get_Config_Switches; Switches : Argument_List_Access := Get_Config_Switches;
Args : Argument_List (1 .. 5); Args : Argument_List (1 .. 5);
Arg_Last : Positive; Arg_Last : Positive;
Obj_Dir_Exists : Boolean := True; Obj_Dir_Exists : Boolean := True;
begin begin
...@@ -748,12 +749,14 @@ package body Prj.Conf is ...@@ -748,12 +749,14 @@ package body Prj.Conf is
if Config_File_Name = "" then if Config_File_Name = "" then
if Obj_Dir_Exists then if Obj_Dir_Exists then
Args (3) := new String' Args (3) :=
(Obj_Dir & Directory_Separator & Auto_Cgpr); new String'(Obj_Dir & Directory_Separator & Auto_Cgpr);
else else
declare declare
Path_FD : File_Descriptor; Path_FD : File_Descriptor;
Path_Name : Path_Name_Type; Path_Name : Path_Name_Type;
begin begin
Prj.Env.Create_Temp_File Prj.Env.Create_Temp_File
(In_Tree => Project_Tree, (In_Tree => Project_Tree,
...@@ -764,9 +767,12 @@ package body Prj.Conf is ...@@ -764,9 +767,12 @@ package body Prj.Conf is
if Path_FD /= Invalid_FD then if Path_FD /= Invalid_FD then
Args (3) := new String'(Get_Name_String (Path_Name)); Args (3) := new String'(Get_Name_String (Path_Name));
GNAT.OS_Lib.Close (Path_FD); GNAT.OS_Lib.Close (Path_FD);
else else
-- We'll have an error message later on -- We'll have an error message later on
Args (3) := new String'
Args (3) :=
new String'
(Obj_Dir & Directory_Separator & Auto_Cgpr); (Obj_Dir & Directory_Separator & Auto_Cgpr);
end if; end if;
end; end;
......
...@@ -44,8 +44,7 @@ package Prj.Env is ...@@ -44,8 +44,7 @@ package Prj.Env is
Path_FD : out File_Descriptor; Path_FD : out File_Descriptor;
Path_Name : out Path_Name_Type; Path_Name : out Path_Name_Type;
File_Use : String); File_Use : String);
-- Create a temporary file, and fail with an error if it could not be -- Create temporary file, and fail with an error if it could not be created
-- created.
procedure Create_Mapping_File procedure Create_Mapping_File
(Project : Project_Id; (Project : Project_Id;
......
...@@ -77,7 +77,6 @@ package body Prj.Ext is ...@@ -77,7 +77,6 @@ package body Prj.Ext is
begin begin
if Tree.Project_Path = null then if Tree.Project_Path = null then
Tree.Project_Path := new String'(Uninitialized_Prefix & Path); Tree.Project_Path := new String'(Uninitialized_Prefix & Path);
else else
Tmp := Tree.Project_Path; Tmp := Tree.Project_Path;
Tree.Project_Path := new String'(Tmp.all & Path_Separator & Path); Tree.Project_Path := new String'(Tmp.all & Path_Separator & Path);
...@@ -85,12 +84,14 @@ package body Prj.Ext is ...@@ -85,12 +84,14 @@ package body Prj.Ext is
end if; end if;
end Add_Search_Project_Directory; end Add_Search_Project_Directory;
-----------
-- Check -- -- Check --
----------- -----------
function Check function Check
(Tree : Prj.Tree.Project_Node_Tree_Ref; (Tree : Prj.Tree.Project_Node_Tree_Ref;
Declaration : String) return Boolean is Declaration : String) return Boolean
is
begin begin
for Equal_Pos in Declaration'Range loop for Equal_Pos in Declaration'Range loop
if Declaration (Equal_Pos) = '=' then if Declaration (Equal_Pos) = '=' then
......
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