exp_ch5.adb (Expand_N_Assignment_Statement): For the assignment of a controlled type...
authorEd Schonberg <schonberg@adacore.com>
Wed, 6 Jun 2007 10:25:25 +0000 (12:25 +0200)
committerArnaud Charlet <charlet@gcc.gnu.org>
Wed, 6 Jun 2007 10:25:25 +0000 (12:25 +0200)
commita79ec8c58c6a8b452a3916fe8d74712c1b0ab708
tree6543f310ee10860562ac2feddf3d18351989eb96
parent26bff3d98f6cf1aad9668c401286ac31822ee986
exp_ch5.adb (Expand_N_Assignment_Statement): For the assignment of a controlled type...

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

* exp_ch5.adb (Expand_N_Assignment_Statement): For the assignment of a
controlled type, use Make_Handler_For_Ctrl_Operation to construct the
required exception handler.
(Expand_Simple_Function_Return, Expand_N_Return_Statement): Handle
properly the case of a function whose return type is a limited
class-wide interface type. Modify the code of the accessibility
check to handle class-wide interface objects. In this case we need to
displace "this" to reference the primary dispatch table to get access
to the TSD of the object (to evaluate its accessibility level).
(Expand_N_Extended_Return_Statement): Test for a tagged result type
rather than a controlling result as one of the conditions for
generating tests of the implicit BIP_Alloc_Form formal. The
initialization assignment is also handled according to whether the
result is tagged instead of controlling.
In the case where the init assignment is inserted in the "then" part of
the allocation conditional, rewrite the target to be a dereference of
the implicit BIP_Object_Access formal.
If the returned value is unconstrained and created on the secondary
stack, mark the enclosing block and function so that the secondary
stack is not reclaimed on return.
Treat returns from functions with controlling results similarly to
returns from functions with unconstrained result subtypes.
If the object returned is unconstrained, and an allocator must be
created for it, analyze the allocator once the block for the extended
return is installed, to ensure that finalizable components
of the expression use the proper finalization list. Guard the call to
Move_Final_List with a check that there is something to finalize.
(Make_Tag_Ctrl_Assignment): Use "old" handling
of controlled type assignment for virtual machines, since new code uses
unsupported features (such as direct access to bytes in memory).

From-SVN: r125398
gcc/ada/exp_ch5.adb