diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index d058d97e5a3..3ef5e6df5e0 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,8 @@ +2009-09-17 Robert Dewar + + * 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 * prj-conf.adb, prj-env.adb, prj-env.ads (Create_Temp_File): Moved to diff --git a/gcc/ada/exp_ch4.adb b/gcc/ada/exp_ch4.adb index 49d23162eb0..6a65e10a167 100644 --- a/gcc/ada/exp_ch4.adb +++ b/gcc/ada/exp_ch4.adb @@ -4120,12 +4120,12 @@ package body Exp_Ch4 is 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)))); @@ -4134,16 +4134,15 @@ package body Exp_Ch4 is 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 @@ -4152,6 +4151,9 @@ package body Exp_Ch4 is 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)); diff --git a/gcc/ada/exp_ch5.adb b/gcc/ada/exp_ch5.adb index 39700bda9e0..021afbf5282 100644 --- a/gcc/ada/exp_ch5.adb +++ b/gcc/ada/exp_ch5.adb @@ -3142,8 +3142,8 @@ package body Exp_Ch5 is -- 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 diff --git a/gcc/ada/exp_ch9.adb b/gcc/ada/exp_ch9.adb index 526a2dd552c..db22726bb64 100644 --- a/gcc/ada/exp_ch9.adb +++ b/gcc/ada/exp_ch9.adb @@ -835,8 +835,8 @@ package body Exp_Ch9 is 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); diff --git a/gcc/ada/prj-conf.adb b/gcc/ada/prj-conf.adb index e1b365e3453..bcf434b15e1 100644 --- a/gcc/ada/prj-conf.adb +++ b/gcc/ada/prj-conf.adb @@ -697,6 +697,7 @@ package body Prj.Conf is Switches : Argument_List_Access := Get_Config_Switches; Args : Argument_List (1 .. 5); Arg_Last : Positive; + Obj_Dir_Exists : Boolean := True; begin @@ -748,12 +749,14 @@ package body Prj.Conf is 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, @@ -764,10 +767,13 @@ package body Prj.Conf is 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; diff --git a/gcc/ada/prj-env.ads b/gcc/ada/prj-env.ads index 8cebad50524..27259c29b98 100644 --- a/gcc/ada/prj-env.ads +++ b/gcc/ada/prj-env.ads @@ -44,8 +44,7 @@ package Prj.Env is 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; diff --git a/gcc/ada/prj-ext.adb b/gcc/ada/prj-ext.adb index 2b41c67702d..9c9707c1cfa 100644 --- a/gcc/ada/prj-ext.adb +++ b/gcc/ada/prj-ext.adb @@ -36,7 +36,7 @@ package body Prj.Ext is -- 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 @@ -77,7 +77,6 @@ package body Prj.Ext is 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); @@ -85,12 +84,14 @@ package body Prj.Ext is 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