From: Arnaud Charlet <charlet@adacore.com>
To: gcc-patches@gcc.gnu.org
Cc: Bob Duff <duff@adacore.com>
Subject: [Ada] Usage of storage pools in build-in-place functions on ZFP
Date: Sat, 15 Oct 2011 10:47:00 -0000 [thread overview]
Message-ID: <20111015092214.GA23183@adacore.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 903 bytes --]
This patch disables the machinery associated with allocating objects on a user
defined storage pool in build-in-place functions ZFP does not support pools.
Tested on x86_64-pc-linux-gnu, committed on trunk
2011-10-15 Bob Duff <duff@adacore.com>
* exp_ch6.adb (Add_Unconstrained_Actuals_To_Build_In_Place_Call):
Do not create a pool formal on unless RE_Root_Storage_Pool_Ptr
is available.
(Expand_N_Extended_Return_Statement): Do not create a renaming of the
build-in-place pool parameter unless RE_Root_Storage_Pool_Ptr is
available.
(Make_Build_In_Place_Call_In_Allocator): Add the user-defined
pool only if RE_Root_Storage_Pool_Ptr is available.
(Make_Build_In_Place_Call_In_Object_Declaration): Do not add a
pool actual unless RE_Root_Storage_Pool_Ptr is available.
* sem_ch6.adb (Create_Extra_Formals): Add build-in-place pool
formal only if RE_Root_Storage_Pool_Ptr is available.
[-- Attachment #2: difs --]
[-- Type: text/plain, Size: 3016 bytes --]
Index: exp_ch6.adb
===================================================================
--- exp_ch6.adb (revision 179986)
+++ exp_ch6.adb (working copy)
@@ -311,10 +311,12 @@
Add_Extra_Actual_To_Call
(Function_Call, Alloc_Form_Formal, Alloc_Form_Actual);
- -- Pass the Storage_Pool parameter. This parameter is omitted on .NET
- -- and JVM as those targets do not support pools.
+ -- Pass the Storage_Pool parameter. This parameter is omitted
+ -- .NET/JVM/ZFP as those targets do not support pools.
- if VM_Target = No_VM then
+ if
+ VM_Target = No_VM and then RTE_Available (RE_Root_Storage_Pool_Ptr)
+ then
Pool_Formal := Build_In_Place_Formal (Function_Id, BIP_Storage_Pool);
Analyze_And_Resolve (Pool_Actual, Etype (Pool_Formal));
Add_Extra_Actual_To_Call
@@ -5241,10 +5243,12 @@
Pool_Allocator := New_Copy_Tree (Heap_Allocator);
-- Do not generate the renaming of the build-in-place
- -- pool parameter on .NET/JVM because the parameter is
- -- not created in the first place.
+ -- pool parameter on .NET/JVM/ZFP because the parameter
+ -- is not created in the first place.
- if VM_Target = No_VM then
+ if VM_Target = No_VM and then
+ RTE_Available (RE_Root_Storage_Pool_Ptr)
+ then
Pool_Decl :=
Make_Object_Renaming_Declaration (Loc,
Defining_Identifier => Pool_Id,
@@ -8137,7 +8141,9 @@
-- has an unconstrained or tagged result type).
if Needs_BIP_Alloc_Form (Enclosing_Func) then
- if VM_Target = No_VM then
+ if VM_Target = No_VM and then
+ RTE_Available (RE_Root_Storage_Pool_Ptr)
+ then
Pool_Actual :=
New_Reference_To (Build_In_Place_Formal
(Enclosing_Func, BIP_Storage_Pool), Loc);
Index: sem_ch6.adb
===================================================================
--- sem_ch6.adb (revision 179986)
+++ sem_ch6.adb (working copy)
@@ -6487,10 +6487,12 @@
E, BIP_Formal_Suffix (BIP_Alloc_Form));
-- Add BIP_Storage_Pool, in case BIP_Alloc_Form indicates to
- -- use a user-defined pool. This formal is not added on .NET
- -- and JVM as those targets do not support pools.
+ -- use a user-defined pool. This formal is not added on
+ -- .NET/JVM/ZFP as those targets do not support pools.
- if VM_Target = No_VM then
+ if VM_Target = No_VM and then
+ RTE_Available (RE_Root_Storage_Pool_Ptr)
+ then
Discard :=
Add_Extra_Formal
(E, RTE (RE_Root_Storage_Pool_Ptr),
reply other threads:[~2011-10-15 9:22 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20111015092214.GA23183@adacore.com \
--to=charlet@adacore.com \
--cc=duff@adacore.com \
--cc=gcc-patches@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).