summaryrefslogtreecommitdiff
path: root/gcc/ada/exp_ch11.adb
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2013-04-11 13:01:09 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2013-04-11 13:01:09 +0000
commit61ce7f9fef885aa5bcd88f971d71e966b7fa4716 (patch)
treefa2d9ffd11568e840f3d65a5a1be065762b60a33 /gcc/ada/exp_ch11.adb
parentef0772bce5d48f185eaf721cfad9543b8707c46b (diff)
downloadgcc-61ce7f9fef885aa5bcd88f971d71e966b7fa4716.tar.gz
2013-04-11 Javier Miranda <miranda@adacore.com>
* exp_ch11.adb (Expand_N_Handled_Sequence_Of_Statements): Do not add cleanup actions in thunks associated with interface types. * exp_ch3.ad[sb] (Is_Variable_Size_Record): Move declaration to the package spec. * exp_ch4.adb (Tagged_Conversion): Update call to Expand_Interface_Conversion since the parameter Is_Static is no longer needed. * exp_ch6.adb (Expand_N_Extended_Return_Statement): Adding assertion to ensure that interface thunks are never handled by this routine. (Expand_N_Simple_Function_Return): Do not rewrite this statement as an extended return statement in interface thunks, and do not perform copy in the secondary stack if the return statement is located in a thunk. * exp_disp.adb (Expand_Dispatching_Call): No longer displace the pointer to the returned object in functions returning interface types. (Expand_Interface_Thunk): For functions returning interface types displace the pointer to the returned object. (Expand_Interface_Conversion): Remove formal Is_Static since this subprogram can now evaluate it locally. * sem_ch3.adb (Add_Internal_Interface_Entities): For functions propagate the type returned by the covered interface primitive to the internal interface entity. Needed by the thunk to generate the code which displaces "this" to reference the corresponding secondary dispatch table. * sem_disp.adb (Propagate_Tag): Update call to Expand_Interface_Conversion since the parameter Is_Static is no longer needed. * sem_res.adb (Resolve_Type_Conversion): Update calls to Expand_Interface_Conversion since the parameter Is_Static is no longer needed plus code cleanup. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@197786 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/exp_ch11.adb')
-rw-r--r--gcc/ada/exp_ch11.adb12
1 files changed, 9 insertions, 3 deletions
diff --git a/gcc/ada/exp_ch11.adb b/gcc/ada/exp_ch11.adb
index 981cd2ad767..7378885c7c2 100644
--- a/gcc/ada/exp_ch11.adb
+++ b/gcc/ada/exp_ch11.adb
@@ -1402,10 +1402,16 @@ package body Exp_Ch11 is
-- Add clean up actions if required
- if Nkind (Parent (N)) /= N_Package_Body
- and then Nkind (Parent (N)) /= N_Accept_Statement
- and then Nkind (Parent (N)) /= N_Extended_Return_Statement
+ if not Nkind_In (Parent (N), N_Package_Body,
+ N_Accept_Statement,
+ N_Extended_Return_Statement)
and then not Delay_Cleanups (Current_Scope)
+
+ -- No cleanup action needed in thunks associated with interfaces
+ -- because they only displace the pointer to the object.
+
+ and then not (Is_Subprogram (Current_Scope)
+ and then Is_Thunk (Current_Scope))
then
Expand_Cleanup_Actions (Parent (N));
else