summaryrefslogtreecommitdiffstats
path: root/polly/lib/CodeGen/BlockGenerators.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'polly/lib/CodeGen/BlockGenerators.cpp')
-rw-r--r--polly/lib/CodeGen/BlockGenerators.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/polly/lib/CodeGen/BlockGenerators.cpp b/polly/lib/CodeGen/BlockGenerators.cpp
index 8f9e0577c17..ae5dc3aedf8 100644
--- a/polly/lib/CodeGen/BlockGenerators.cpp
+++ b/polly/lib/CodeGen/BlockGenerators.cpp
@@ -408,7 +408,11 @@ Value *BlockGenerator::getOrCreateAlloca(const ScopArrayInfo *Array) {
else
NameExt = ".s2a";
- Addr = new AllocaInst(Ty, ScalarBase->getName() + NameExt);
+ const DataLayout &DL
+ = Builder.GetInsertBlock()->getParent()->getParent()->getDataLayout();
+
+ Addr = new AllocaInst(Ty, DL.getAllocaAddrSpace(),
+ ScalarBase->getName() + NameExt);
EntryBB = &Builder.GetInsertBlock()->getParent()->getEntryBlock();
Addr->insertBefore(&*EntryBB->getFirstInsertionPt());
OpenPOWER on IntegriCloud