+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>
* prj-conf.adb, prj-env.adb, prj-env.ads (Create_Temp_File): Moved to
Then_Statements => New_List (
Make_Assignment_Statement (Sloc (Thenx),
- Name => New_Occurrence_Of (Cnn, Sloc (Thenx)),
+ Name => New_Occurrence_Of (Cnn, Sloc (Thenx)),
Expression => Relocate_Node (Thenx))),
Else_Statements => New_List (
Make_Assignment_Statement (Sloc (Elsex),
- Name => New_Occurrence_Of (Cnn, Sloc (Elsex)),
+ Name => New_Occurrence_Of (Cnn, Sloc (Elsex)),
Expression => Relocate_Node (Elsex))));
Set_Assignment_OK (Name (First (Then_Statements (New_If))));
New_N := New_Occurrence_Of (Cnn, Loc);
else
-
-- No expansion needed, gigi handles it like a C conditional
-- expression.
return;
end if;
- -- Move the SLOC of the parent If statement to the newly created one
- -- and change it to the SLOC of the expression which, after
- -- expansion, will correspond to what is being evaluated.
+ -- Move the SLOC of the parent If statement to the newly created one and
+ -- change it to the SLOC of the expression which, after expansion, will
+ -- correspond to what is being evaluated.
if Present (Parent (N))
and then Nkind (Parent (N)) = N_If_Statement
Set_Sloc (Parent (N), Loc);
end if;
+ -- Make sure Then_Actions and Else_Actions are appropriately moved
+ -- to the new if statement.
+
if Present (Then_Actions (N)) then
Insert_List_Before
(First (Then_Statements (New_If)), Then_Actions (N));
-- 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.
- -- Third, we remove elsif parts which have non-empty Condition_Actions
- -- and rewrite as independent if statements. For example:
+ -- Third, we remove elsif parts which have non-empty Condition_Actions and
+ -- rewrite as independent if statements. For example:
-- if x then xs
-- elsif y then ys
end loop;
-- If we are in a package body, the activation chain variable is
- -- declared in the body, but the Activation_Chain_Entity is attached to
- -- the spec.
+ -- declared in the body, but the Activation_Chain_Entity is attached
+ -- to the spec.
if Nkind (P) = N_Package_Body then
Decls := Declarations (P);
Switches : Argument_List_Access := Get_Config_Switches;
Args : Argument_List (1 .. 5);
Arg_Last : Positive;
+
Obj_Dir_Exists : Boolean := True;
begin
if Config_File_Name = "" then
if Obj_Dir_Exists then
- Args (3) := new String'
- (Obj_Dir & Directory_Separator & Auto_Cgpr);
+ Args (3) :=
+ new String'(Obj_Dir & Directory_Separator & Auto_Cgpr);
+
else
declare
- Path_FD : File_Descriptor;
+ Path_FD : File_Descriptor;
Path_Name : Path_Name_Type;
+
begin
Prj.Env.Create_Temp_File
(In_Tree => Project_Tree,
if Path_FD /= Invalid_FD then
Args (3) := new String'(Get_Name_String (Path_Name));
GNAT.OS_Lib.Close (Path_FD);
+
else
-- We'll have an error message later on
- Args (3) := new String'
- (Obj_Dir & Directory_Separator & Auto_Cgpr);
+
+ Args (3) :=
+ new String'
+ (Obj_Dir & Directory_Separator & Auto_Cgpr);
end if;
end;
end if;
Path_FD : out File_Descriptor;
Path_Name : out Path_Name_Type;
File_Use : String);
- -- Create a temporary file, and fail with an error if it could not be
- -- created.
+ -- Create temporary file, and fail with an error if it could not be created
procedure Create_Mapping_File
(Project : Project_Id;
-- Indicator in the project path to indicate that the default search
-- directories should not be added to the path
- Uninitialized_Prefix : constant String := '#' & Path_Separator;
+ Uninitialized_Prefix : constant String := '#' & Path_Separator;
-- Prefix to indicate that the project path has not been initilized yet.
-- Must be two characters long
begin
if Tree.Project_Path = null then
Tree.Project_Path := new String'(Uninitialized_Prefix & Path);
-
else
Tmp := Tree.Project_Path;
Tree.Project_Path := new String'(Tmp.all & Path_Separator & Path);
end if;
end Add_Search_Project_Directory;
+ -----------
-- Check --
-----------
function Check
(Tree : Prj.Tree.Project_Node_Tree_Ref;
- Declaration : String) return Boolean is
+ Declaration : String) return Boolean
+ is
begin
for Equal_Pos in Declaration'Range loop
if Declaration (Equal_Pos) = '=' then