Commit a7c764a9 by Arnaud Charlet

[multiple changes]

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.

From-SVN: r164173
parent ed0af3ba
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> 2010-09-10 Robert Dewar <dewar@adacore.com>
* symbols-processing-vms-alpha.adb: Minor reformatting. * symbols-processing-vms-alpha.adb: Minor reformatting.
......
...@@ -139,7 +139,7 @@ package body Bindgen is ...@@ -139,7 +139,7 @@ package body Bindgen is
-- Heap_Size is the heap to use for memory allocations set by use of a -- 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. -- -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 -- WC_Encoding shows the wide character encoding method used for the main
-- program. This is one of the encoding letters defined in -- program. This is one of the encoding letters defined in
......
...@@ -193,7 +193,7 @@ package body Exp_CG is ...@@ -193,7 +193,7 @@ package body Exp_CG is
declare declare
Result : Natural := Prefix_Length + 1; Result : Natural := Prefix_Length + 1;
begin begin
while Nr > 10 loop while Nr >= 10 loop
Result := Result + 1; Result := Result + 1;
Nr := Nr / 10; Nr := Nr / 10;
end loop; end loop;
...@@ -324,12 +324,22 @@ package body Exp_CG is ...@@ -324,12 +324,22 @@ package body Exp_CG is
declare declare
Copy : constant Node_Id := New_Copy (N); Copy : constant Node_Id := New_Copy (N);
Par : Node_Id;
begin begin
-- Copy the link to the parent to allow climbing up the tree -- Determine the enclosing scope to use when generating the
-- when the call-graph information is generated -- 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); Call_Graph_Nodes.Append (Copy);
end; end;
end if; end if;
...@@ -378,20 +388,9 @@ package body Exp_CG is ...@@ -378,20 +388,9 @@ package body Exp_CG is
Ctrl_Arg : constant Node_Id := Controlling_Argument (Call); Ctrl_Arg : constant Node_Id := Controlling_Argument (Call);
Ctrl_Typ : constant Entity_Id := Base_Type (Etype (Ctrl_Arg)); Ctrl_Typ : constant Entity_Id := Base_Type (Etype (Ctrl_Arg));
Prim : constant Entity_Id := Entity (Sinfo.Name (Call)); Prim : constant Entity_Id := Entity (Sinfo.Name (Call));
P : Node_Id; P : constant Node_Id := Parent (Call);
begin 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_Str ("edge: { sourcename: ");
Write_Char ('"'); Write_Char ('"');
Get_External_Name (Defining_Entity (P), Has_Suffix => False); Get_External_Name (Defining_Entity (P), Has_Suffix => False);
......
...@@ -5259,6 +5259,11 @@ package body Exp_Ch9 is ...@@ -5259,6 +5259,11 @@ package body Exp_Ch9 is
Declarations => Declarations (N), Declarations => Declarations (N),
Handled_Statement_Sequence => Build_Accept_Body (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 -- Prepend call to Accept_Call to main statement sequence If the
-- accept has exception handlers, the statement sequence is wrapped -- accept has exception handlers, the statement sequence is wrapped
-- in a block. Insert call and renaming declarations in the -- in a block. Insert call and renaming declarations in the
......
...@@ -1014,6 +1014,10 @@ package body Exp_Intr is ...@@ -1014,6 +1014,10 @@ package body Exp_Intr is
Append_To (Stmts, Free_Node); Append_To (Stmts, Free_Node);
Set_Storage_Pool (Free_Node, Pool); Set_Storage_Pool (Free_Node, Pool);
-- Attach to tree before analysis of generated subtypes below.
Set_Parent (Stmts, Parent (N));
-- Deal with storage pool -- Deal with storage pool
if Present (Pool) then if Present (Pool) then
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment