From: Arnaud Charlet Date: Mon, 17 Aug 2009 09:45:27 +0000 (+0200) Subject: [multiple changes] X-Git-Tag: releases/gcc-4.5.0~3983 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5568b57c5101ca0a9a38e9d080a07712946a8f54;p=thirdparty%2Fgcc.git [multiple changes] 2009-08-17 Ed Schonberg * exp_ch3.adb (Build_Discriminant_Formals): If the discriminals already exist, as is the case for synchronized types, use the type of the discriminal in the parameter specification, to prevent a spurious subtype mismatch in gigi. 2009-08-17 Robert Dewar * prj-env.adb: Minor reformatting * make.adb: Minor reformatting Comment updates 2009-08-17 Javier Miranda * exp_ch7.adb (Wrap_Transient_Expression): Update comments. From-SVN: r150828 --- diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index ebbd96d6cc25..a8cc86b4770b 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,27 @@ +2009-08-17 Ed Schonberg + + * exp_ch3.adb (Build_Discriminant_Formals): If the discriminals already + exist, as is the case for synchronized types, use the type of the + discriminal in the parameter specification, to prevent a spurious + subtype mismatch in gigi. + +2009-08-17 Robert Dewar + + * prj-env.adb: Minor reformatting + * make.adb: Minor reformatting + Comment updates + +2009-08-17 Javier Miranda + + * exp_ch7.adb (Wrap_Transient_Expression): Update comments. + +2009-08-17 Emmanuel Briot + + * prj-part.adb, prj.adb, prj.ads, prj-nmsc.adb, prj-conf.adb + (Processing_Flags.Require_Obj_Dirs): new field, which controls whether + object directories must be present. In the case of gprclean at least, + these are optional (if they do not exist there is nothing to clean) + 2009-08-17 Robert Dewar * prj-env.adb: Minor reformatting diff --git a/gcc/ada/exp_ch3.adb b/gcc/ada/exp_ch3.adb index c0861e308908..414e56701155 100644 --- a/gcc/ada/exp_ch3.adb +++ b/gcc/ada/exp_ch3.adb @@ -95,10 +95,11 @@ package body Exp_Ch3 is (Rec_Id : Entity_Id; Use_Dl : Boolean) return List_Id; -- This function uses the discriminants of a type to build a list of - -- formal parameters, used in the following function. If the flag Use_Dl - -- is set, the list is built using the already defined discriminals - -- of the type. Otherwise new identifiers are created, with the source - -- names of the discriminants. + -- formal parameters, used in Build_Init_Procedure among other places. + -- If the flag Use_Dl is set, the list is built using the already + -- defined discriminals of the type, as is the case for concurrent + -- types with discriminants. Otherwise new identifiers are created, + -- with the source names of the discriminants. function Build_Equivalent_Array_Aggregate (T : Entity_Id) return Node_Id; -- This function builds a static aggregate that can serve as the initial @@ -1141,6 +1142,7 @@ package body Exp_Ch3 is Parameter_List : constant List_Id := New_List; D : Entity_Id; Formal : Entity_Id; + Formal_Type : Entity_Id; Param_Spec_Node : Node_Id; begin @@ -1151,15 +1153,17 @@ package body Exp_Ch3 is if Use_Dl then Formal := Discriminal (D); + Formal_Type := Etype (Formal); else Formal := Make_Defining_Identifier (Loc, Chars (D)); + Formal_Type := Etype (D); end if; Param_Spec_Node := Make_Parameter_Specification (Loc, Defining_Identifier => Formal, Parameter_Type => - New_Reference_To (Etype (D), Loc)); + New_Reference_To (Formal_Type, Loc)); Append (Param_Spec_Node, Parameter_List); Next_Discriminant (D); end loop; diff --git a/gcc/ada/exp_ch7.adb b/gcc/ada/exp_ch7.adb index 8e7ecbc41106..a4f6a66fd9ba 100644 --- a/gcc/ada/exp_ch7.adb +++ b/gcc/ada/exp_ch7.adb @@ -3554,9 +3554,7 @@ package body Exp_Ch7 is Loc : constant Source_Ptr := Sloc (N); E : constant Entity_Id := Make_Temporary (Loc, 'E', N); Etyp : constant Entity_Id := Etype (N); - - Expr : constant Node_Id := Relocate_Node (N); - -- Capture this node because the call to Adjust_SCIL_Node can ??? + Expr : constant Node_Id := Relocate_Node (N); begin -- If the relocated node is a function call then check if some SCIL diff --git a/gcc/ada/make.adb b/gcc/ada/make.adb index 8b5bb0022f9b..69e00f31ecec 100644 --- a/gcc/ada/make.adb +++ b/gcc/ada/make.adb @@ -645,7 +645,7 @@ package body Make is -- the fact that this ALI file is read-only. procedure Process_Multilib; - -- Add appropriate --RTS argument to handle multilib. + -- Add appropriate --RTS argument to handle multilib ---------------------------------------------------- -- Compiler, Binder & Linker Data and Subprograms -- @@ -7304,7 +7304,6 @@ package body Make is ---------------------- procedure Process_Multilib is - Output_FD : File_Descriptor; Output_Name : String_Access; Arg_Index : Natural := 0; @@ -7331,7 +7330,6 @@ package body Make is Arg_Index := Arg_Index + 1; Args (Arg_Index) := new String'(Argv); end if; - end; end loop; @@ -7345,22 +7343,24 @@ package body Make is Multilib_Gcc := Gcc; end if; - Multilib_Gcc_Path := - GNAT.OS_Lib.Locate_Exec_On_Path (Multilib_Gcc.all); + Multilib_Gcc_Path := GNAT.OS_Lib.Locate_Exec_On_Path (Multilib_Gcc.all); Create_Temp_File (Output_FD, Output_Name); + if Output_FD = Invalid_FD then return; end if; - GNAT.OS_Lib.Spawn (Multilib_Gcc_Path.all, Args, Output_FD, - Return_Code, False); + GNAT.OS_Lib.Spawn + (Multilib_Gcc_Path.all, Args, Output_FD, Return_Code, False); Close (Output_FD); + if Return_Code /= 0 then return; end if; Output_FD := Open_Read (Output_Name.all, Binary); + if Output_FD = Invalid_FD then return; end if; @@ -7382,9 +7382,7 @@ package body Make is end if; Scan_Make_Arg ("-margs", And_Save => True); - Scan_Make_Arg ("--RTS=" & Line (1 .. N_Read), - And_Save => True); - + Scan_Make_Arg ("--RTS=" & Line (1 .. N_Read), And_Save => True); end Process_Multilib; ----------------------------- @@ -7396,6 +7394,7 @@ package body Make is Seen : Project_Boolean_Htable.Instance := Project_Boolean_Htable.Nil; procedure Recurse (Prj : Project_Id; Depth : Natural); + -- Recursive procedure that does the work, keeping track of the depth ------------- -- Recurse -- diff --git a/gcc/ada/prj-env.adb b/gcc/ada/prj-env.adb index c14cbd63d207..0ffacdbdc5b5 100644 --- a/gcc/ada/prj-env.adb +++ b/gcc/ada/prj-env.adb @@ -222,8 +222,6 @@ package body Prj.Env is -- Add_To_Buffer -- ------------------- - -- Wouldn't it be more consistent to use a Table for Buffer ??? - procedure Add_To_Buffer (S : String; Buffer : in out String_Access; @@ -236,7 +234,6 @@ package body Prj.Env is declare New_Buffer : constant String_Access := new String (1 .. 2 * Buffer'Last); - begin New_Buffer (1 .. Buffer_Last) := Buffer (1 .. Buffer_Last); Free (Buffer);