diff options
-rw-r--r-- | gcc/ada/ChangeLog | 15 | ||||
-rw-r--r-- | gcc/ada/bindgen.adb | 2 | ||||
-rw-r--r-- | gcc/ada/exp_cg.adb | 31 | ||||
-rw-r--r-- | gcc/ada/exp_ch9.adb | 5 | ||||
-rw-r--r-- | gcc/ada/exp_intr.adb | 4 |
5 files changed, 40 insertions, 17 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 057ddff7d90..da9e0c06b78 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,18 @@ +2010-09-10 Doug Rupp <rupp@adacore.com> + + * bindgen.adb: Minor comment fix for -H switch. + +2010-09-10 Ed Schonberg <schonberg@adacore.com> + + * 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 <dewar@adacore.com> * symbols-processing-vms-alpha.adb: Minor reformatting. diff --git a/gcc/ada/bindgen.adb b/gcc/ada/bindgen.adb index 6d1642d488b..df47274e979 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 e7decc8f1e7..aad5157d9e3 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 f272b951b1c..a91ec6a4c22 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 0c4a67cb684..ecf10265056 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 |