summaryrefslogtreecommitdiff
path: root/gcc/ada/sem_ch6.adb
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2011-10-13 10:37:33 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2011-10-13 10:37:33 +0000
commit52b3bcf2efa74aba858df98905b42b9535c9a565 (patch)
treef5ced87e3f9f879a7bb3f9307840a47ec4111780 /gcc/ada/sem_ch6.adb
parentc310752724a6c7b262a7c91275bae6579f607e0e (diff)
downloadgcc-52b3bcf2efa74aba858df98905b42b9535c9a565.tar.gz
2011-10-13 Bob Duff <duff@adacore.com>
* exp_ch6.ads (BIP_Storage_Pool): New "extra implicit parameter" that gets passed in the same cases where BIP_Alloc_Form is passed (caller-unknown-size results). BIP_Storage_Pool is used when BIP_Alloc_Form = User_Storage_Pool. In that case, a pointer to the user-defined storage pool is passed at the call site, and this pool is used in callee to allocate the result. * exp_ch6.adb (Add_Unconstrained_Actuals_To_Build_In_Place_Call): New version of Add_Alloc_Form_Actual_To_Build_In_Place_Call. Passes the additional BIP_Storage_Pool actual. (Expand_N_Extended_Return_Statement): Allocate the function result using the user-defined storage pool, if BIP_Alloc_Form = User_Storage_Pool. * sem_ch6.adb: Add the "extra formal" for BIP_Storage_Pool. * exp_ch4.adb: Don't overwrite storage pool set by Expand_N_Extended_Return_Statement. * s-stopoo.ads, rtsfind.ads (Root_Storage_Pool_Ptr): New type, for use in build-in-place function calls within allocators where the access type has a user-defined storage pool. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@179903 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/sem_ch6.adb')
-rw-r--r--gcc/ada/sem_ch6.adb9
1 files changed, 9 insertions, 0 deletions
diff --git a/gcc/ada/sem_ch6.adb b/gcc/ada/sem_ch6.adb
index 3c5e3f834fe..26dac7789d5 100644
--- a/gcc/ada/sem_ch6.adb
+++ b/gcc/ada/sem_ch6.adb
@@ -6482,6 +6482,15 @@ package body Sem_Ch6 is
Add_Extra_Formal
(E, Standard_Natural,
E, BIP_Formal_Suffix (BIP_Alloc_Form));
+
+ -- Whenever we need BIP_Alloc_Form, we also need
+ -- BIP_Storage_Pool, in case BIP_Alloc_Form indicates to use a
+ -- user-defined pool.
+
+ Discard :=
+ Add_Extra_Formal
+ (E, RTE (RE_Root_Storage_Pool_Ptr),
+ E, BIP_Formal_Suffix (BIP_Storage_Pool));
end if;
-- In the case of functions whose result type needs finalization,