diff options
author | Javier Miranda <miranda@adacore.com> | 2019-12-13 09:04:18 +0000 |
---|---|---|
committer | Pierre-Marie de Rodat <pmderodat@gcc.gnu.org> | 2019-12-13 09:04:18 +0000 |
commit | 20dc266e5a178fd87bb8ae6ebbf63e391f74e9b0 (patch) | |
tree | 76f6ee6f563585d48c5854f40e3ced0a9640bc7e /gcc/ada/exp_disp.ads | |
parent | 6c9e4a1d65bc7ff2747f714ebb48a41827f4f74b (diff) | |
download | gcc-20dc266e5a178fd87bb8ae6ebbf63e391f74e9b0.zip gcc-20dc266e5a178fd87bb8ae6ebbf63e391f74e9b0.tar.gz gcc-20dc266e5a178fd87bb8ae6ebbf63e391f74e9b0.tar.bz2 |
[Ada] Deallocation of controlled type implementing interface types
2019-12-13 Javier Miranda <miranda@adacore.com>
gcc/ada/
* exp_disp.ads (Expand_Interface_Thunk): Adding one formal (the
interface type).
* exp_disp.adb (Expand_Interface_Thunk): Using the added formal
to ensure the correct profile of the thunk generated for
predefined primitives; in addition, the added formal is also
used to perform a check that ensures that the controlling type
of the thunk is the one expected by the GCC backend.
(Make_Secondary_DT, Register_Primitive): Adding the new formal
to the calls to Expand_Interface_Thunk.
* exp_ch6.adb (Register_Predefined_DT_Entry): Adding the new
formal to the call to Expand_Interface_Thunk.
* exp_intr.adb (Expand_Unc_Deallocation): When deallocating a
controlled type and the call to unchecked deallocation is
performed with a pointer to one of the convered interface types,
displace the pointer to the object to reference the base of the
object to deallocate its memory.
* gcc-interface/trans.c (maybe_make_gnu_thunk): Assert that the
controlling type of the thunk is an interface type.
From-SVN: r279351
Diffstat (limited to 'gcc/ada/exp_disp.ads')
-rw-r--r-- | gcc/ada/exp_disp.ads | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/ada/exp_disp.ads b/gcc/ada/exp_disp.ads index 7295942..5c490df 100644 --- a/gcc/ada/exp_disp.ads +++ b/gcc/ada/exp_disp.ads @@ -242,7 +242,8 @@ package Exp_Disp is procedure Expand_Interface_Thunk (Prim : Node_Id; Thunk_Id : out Entity_Id; - Thunk_Code : out Node_Id); + Thunk_Code : out Node_Id; + Iface : Entity_Id); -- Ada 2005 (AI-251): When a tagged type implements abstract interfaces we -- generate additional subprograms (thunks) associated with each primitive -- Prim to have a layout compatible with the C++ ABI. The thunk displaces |