Commit 7888a6ae by Gary Dismukes Committed by Arnaud Charlet

exp_ch6.ads, [...] (Expand_Call): When adding an extra accessibility actual...

2007-04-20  Gary Dismukes  <dismukes@adacore.com>
	    Ed Schonberg  <schonberg@adacore.com>

	* exp_ch6.ads, exp_ch6.adb (Expand_Call): When adding an extra
	accessibility actual, check for the case of an aliased object that has
	been rewritten as an Access attribute, and assign Prev to Prev_Orig so
	we fall into processing for the attribute rather than the name of the
	object.
	(Expand_Inline_Call): If an actual is a literal, and the corresponding
	formal has its address taken in the body, create a temporary to capture
	value.  If the return type is a limited interface, do not treat the
	return value as Controlled.
	(Is_In_Place_Function):  If the return type is a limited interface,
	treat as returning in place. The actual returned object may not always
	be limited, but the caller has to assume that it is returned in place.
	(Add_Final_List_Actual_To_Build_In_Place_Call): If the call is the
	context of an allocator, use the correct finalization chain (that is,
	the chain belonging to the access type, rather than the chain belonging
	to the current scope).
	(Add_Alloc_Form_Actual_To_Build_In_Place_Call): Test for a tagged
	result type rather than a controlling result as a precondition for
	adding an allocation form actual to a build-in-place call.
	(Add_Final_List_Actual_To_Build_In_Place_Call): Ditto.
	(Freeze_Subprogram): Code cleanup. Remove all the code that register the
	primitive in the dispatch tables. This work is now done by Make_DT when
	the type is frozen.
	(Register_Predefined_DT_Entry): Removed.
	(Add_Return): If end label is not present, use sloc of last statement
	for generated return statement in procedure, for better gdb behavior
	on expanded code.
	(Add_Access_Actual_To_Build_In_Place_Call): Set parent fields of the
	object address nodes to ensure proper processing by routines like
	Insert_After*.
	(Expand_Call): Fix generation of validity check for parameter
	(Add_Alloc_Form_Actual_To_Build_In_Place_Call): Return without passing
	the allocation form parameter if the result subtype is constrained,
	except when the function has a controlling result.
	(Add_Final_List_Actual_To_Build_In_Place_Call): Test Controlled_Type
	rather than Is_Controlled and Has_Controlled_Component, since we want to
	include class-wide result types in this treatment. Also test for a
	controlling result, since that also requires passing a finalization
	list.
	(Make_Build_In_Place_Call_In_Allocator): Call Add_Alloc_Form_Actual_*
	even when the result subtype is constrained, to handle calls involving
	controlling results.
	(Make_Build_In_Place_Call_In_Anonymous_Context): Add_Alloc_Form_Actual_*
	is now called even when the result subtype is constrained, to handle
	calls involving controlling results.
	(Make_Build_In_Place_Call_In_Assignment): Remove test for Is_Constrained
	on call to Add_Alloc_Form_Actual_To_Build_In_Place_Call (that procedure
	now performs the test).
	(Make_Build_In_Place_Call_In_Object_Declaration):
	Add_Alloc_Form_Actual_* is now called even when the result subtype is
	constrained, to handle calls involving controlling results.
	(Add_Return): Accomodate rewritten pattern from local raise to goto
	transformation, so that we still recognize an transfer statement
	and do the right thing here in that case.
	(Expand_N_Subprogram_Body): Add dummy Push/Pop_xxx_Label nodes at start
	and end of subprogram code.
	(Register_Interface_DT_Entry, Register_Predefined_DT_Entry): Add missing
	support for primitives that are functions (without formals) with a
	controlling result.
	(Inherited_From_Formal): If the actual subtype has not generic parent
	type, it is not an actual for a formal derived type, and there is no
	operation to inherit from the formal.

From-SVN: r125399
parent a79ec8c5
......@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
-- Copyright (C) 1992-2006, Free Software Foundation, Inc. --
-- Copyright (C) 1992-2007, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
......@@ -61,10 +61,10 @@ package Exp_Ch6 is
-- enumeration literals matches the order in which the formals are
-- declared. See Sem_Ch6.Create_Extra_Formals.
(BIP_Alloc_Form,
-- Present if result subtype is unconstrained. Indicates whether the
-- return object is allocated by the caller or callee, and if the
-- callee, whether to use the secondary stack or the heap. See
-- Create_Extra_Formals.
-- Present if result subtype is unconstrained, or if the result type
-- is tagged. Indicates whether the return object is allocated by the
-- caller or callee, and if the callee, whether to use the secondary
-- stack or the heap. See Create_Extra_Formals.
BIP_Final_List,
-- Present if result type has controlled parts. Pointer to caller's
-- finalization list.
......@@ -162,10 +162,4 @@ package Exp_Ch6 is
-- for which Is_Build_In_Place_Call is True, or an N_Qualified_Expression
-- node applied to such a function call.
procedure Register_Interface_DT_Entry
(Related_Nod : Node_Id;
Prim : Entity_Id);
-- Ada 2005 (AI-251): Register a primitive in a secondary dispatch table.
-- Related_Nod is the node after which the expanded code will be inserted.
end Exp_Ch6;
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