From: Arnaud Charlet Date: Fri, 10 Sep 2010 13:40:50 +0000 (+0200) Subject: [multiple changes] X-Git-Tag: releases/gcc-4.6.0~4426 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a7c764a96ca48293b863196a073eb119453e1a3b;p=thirdparty%2Fgcc.git [multiple changes] 2010-09-10 Doug Rupp * bindgen.adb: Minor comment fix for -H switch. 2010-09-10 Ed Schonberg * exp_cg.adb (Register_CG_Node): Determine enclosing subprogram or library unit now, by traversing tree before context is expanded. (Write_Call_Info): Use enclosing unit name directly. * exp_ch9.adb (Expand_N_Accept_Statement): Attach generated block to tree earlier, to ensure that subsequent declarations are analyzed in a connected structure. * exp_intr.adb (Expand_Unc_Deallocation): Ditto for generated statement list. From-SVN: r164173 --- diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 057ddff7d901..da9e0c06b78b 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,18 @@ +2010-09-10 Doug Rupp + + * bindgen.adb: Minor comment fix for -H switch. + +2010-09-10 Ed Schonberg + + * exp_cg.adb (Register_CG_Node): Determine enclosing subprogram or + library unit now, by traversing tree before context is expanded. + (Write_Call_Info): Use enclosing unit name directly. + * exp_ch9.adb (Expand_N_Accept_Statement): Attach generated block to + tree earlier, to ensure that subsequent declarations are analyzed in a + connected structure. + * exp_intr.adb (Expand_Unc_Deallocation): Ditto for generated statement + list. + 2010-09-10 Robert Dewar * symbols-processing-vms-alpha.adb: Minor reformatting. diff --git a/gcc/ada/bindgen.adb b/gcc/ada/bindgen.adb index 6d1642d488b7..df47274e9795 100644 --- a/gcc/ada/bindgen.adb +++ b/gcc/ada/bindgen.adb @@ -139,7 +139,7 @@ package body Bindgen is -- Heap_Size is the heap to use for memory allocations set by use of a -- -Hnn parameter for the binder or by the GNAT$NO_MALLOC_64 logical. - -- Valid values are 32 and 64. This switch is only available on VMS. + -- Valid values are 32 and 64. This switch is only effective on VMS. -- WC_Encoding shows the wide character encoding method used for the main -- program. This is one of the encoding letters defined in diff --git a/gcc/ada/exp_cg.adb b/gcc/ada/exp_cg.adb index e7decc8f1e74..aad5157d9e32 100644 --- a/gcc/ada/exp_cg.adb +++ b/gcc/ada/exp_cg.adb @@ -193,7 +193,7 @@ package body Exp_CG is declare Result : Natural := Prefix_Length + 1; begin - while Nr > 10 loop + while Nr >= 10 loop Result := Result + 1; Nr := Nr / 10; end loop; @@ -324,12 +324,22 @@ package body Exp_CG is declare Copy : constant Node_Id := New_Copy (N); + Par : Node_Id; begin - -- Copy the link to the parent to allow climbing up the tree - -- when the call-graph information is generated + -- Determine the enclosing scope to use when generating the + -- call graph. This must be done now to avoid problems with + -- control structures that may be rewritten during expansion. + + Par := Parent (N); + while Nkind (Par) /= N_Subprogram_Body + and then Nkind (Parent (Par)) /= N_Compilation_Unit + loop + Par := Parent (Par); + pragma Assert (Present (Par)); + end loop; - Set_Parent (Copy, Parent (N)); + Set_Parent (Copy, Par); Call_Graph_Nodes.Append (Copy); end; end if; @@ -378,20 +388,9 @@ package body Exp_CG is Ctrl_Arg : constant Node_Id := Controlling_Argument (Call); Ctrl_Typ : constant Entity_Id := Base_Type (Etype (Ctrl_Arg)); Prim : constant Entity_Id := Entity (Sinfo.Name (Call)); - P : Node_Id; + P : constant Node_Id := Parent (Call); begin - -- Locate the enclosing context: a subprogram (if available) or the - -- enclosing library-level package - - P := Parent (Call); - while Nkind (P) /= N_Subprogram_Body - and then Nkind (Parent (P)) /= N_Compilation_Unit - loop - P := Parent (P); - pragma Assert (Present (P)); - end loop; - Write_Str ("edge: { sourcename: "); Write_Char ('"'); Get_External_Name (Defining_Entity (P), Has_Suffix => False); diff --git a/gcc/ada/exp_ch9.adb b/gcc/ada/exp_ch9.adb index f272b951b1c5..a91ec6a4c225 100644 --- a/gcc/ada/exp_ch9.adb +++ b/gcc/ada/exp_ch9.adb @@ -5259,6 +5259,11 @@ package body Exp_Ch9 is Declarations => Declarations (N), Handled_Statement_Sequence => Build_Accept_Body (N)); + -- For the analysis of the generated declarations, the parent node + -- must be properly set. + + Set_Parent (Block, Parent (N)); + -- Prepend call to Accept_Call to main statement sequence If the -- accept has exception handlers, the statement sequence is wrapped -- in a block. Insert call and renaming declarations in the diff --git a/gcc/ada/exp_intr.adb b/gcc/ada/exp_intr.adb index 0c4a67cb6841..ecf102650569 100644 --- a/gcc/ada/exp_intr.adb +++ b/gcc/ada/exp_intr.adb @@ -1014,6 +1014,10 @@ package body Exp_Intr is Append_To (Stmts, Free_Node); Set_Storage_Pool (Free_Node, Pool); + -- Attach to tree before analysis of generated subtypes below. + + Set_Parent (Stmts, Parent (N)); + -- Deal with storage pool if Present (Pool) then