* 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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@164173
138bc75d-0d04-0410-961f-
82ee72b054a4
+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.
-- 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
declare
Result : Natural := Prefix_Length + 1;
begin
- while Nr > 10 loop
+ while Nr >= 10 loop
Result := Result + 1;
Nr := Nr / 10;
end loop;
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;
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);
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
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