summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
authorYaxun Liu <Yaxun.Liu@amd.com>2017-05-18 18:51:09 +0000
committerYaxun Liu <Yaxun.Liu@amd.com>2017-05-18 18:51:09 +0000
commit6d96f163476be00b36a9acf0d5abe1ac0136e12f (patch)
treee2c369d3a0e3bbefc85bc981d62707f91b9abb26 /clang/lib/CodeGen/CodeGenModule.cpp
parentb00ffd8cb7a0f5fd51c9968e4f59b4b3eca52e47 (diff)
downloadbcm5719-llvm-6d96f163476be00b36a9acf0d5abe1ac0136e12f.tar.gz
bcm5719-llvm-6d96f163476be00b36a9acf0d5abe1ac0136e12f.zip
CodeGen: Cast alloca to expected address space
Alloca always returns a pointer in alloca address space, which may be different from the type defined by the language. For example, in C++ the auto variables are in the default address space. Therefore cast alloca to the expected address space when necessary. Differential Revision: https://reviews.llvm.org/D32248 llvm-svn: 303370
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenModule.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp
index a0254797ea4..dee4351a51e 100644
--- a/clang/lib/CodeGen/CodeGenModule.cpp
+++ b/clang/lib/CodeGen/CodeGenModule.cpp
@@ -113,6 +113,7 @@ CodeGenModule::CodeGenModule(ASTContext &C, const HeaderSearchOptions &HSO,
Int8PtrPtrTy = Int8PtrTy->getPointerTo(0);
AllocaInt8PtrTy = Int8Ty->getPointerTo(
M.getDataLayout().getAllocaAddrSpace());
+ ASTAllocaAddressSpace = getTargetCodeGenInfo().getASTAllocaAddressSpace();
RuntimeCC = getTargetCodeGenInfo().getABIInfo().getRuntimeCC();
BuiltinCC = getTargetCodeGenInfo().getABIInfo().getBuiltinCC();
OpenPOWER on IntegriCloud