diff options
| author | Pekka Jaaskelainen <pekka.jaaskelainen@tut.fi> | 2014-08-14 09:37:50 +0000 |
|---|---|---|
| committer | Pekka Jaaskelainen <pekka.jaaskelainen@tut.fi> | 2014-08-14 09:37:50 +0000 |
| commit | ab751a8f71d7dc4a463aa0bd837c59513697ed06 (patch) | |
| tree | 698010329814e22086b3281f37108ec4e5c6f606 /clang/lib | |
| parent | cdb45fa391125685e2e17795f4fddda5a867af52 (diff) | |
| download | bcm5719-llvm-ab751a8f71d7dc4a463aa0bd837c59513697ed06.tar.gz bcm5719-llvm-ab751a8f71d7dc4a463aa0bd837c59513697ed06.zip | |
Fix a crash when compiling blocks in OpenCL with multiple
address spaces.
llvm-svn: 215629
Diffstat (limited to 'clang/lib')
| -rw-r--r-- | clang/lib/CodeGen/CGBlocks.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CGBlocks.cpp b/clang/lib/CodeGen/CGBlocks.cpp index 06ad552bde4..2fe93f87ccc 100644 --- a/clang/lib/CodeGen/CGBlocks.cpp +++ b/clang/lib/CodeGen/CGBlocks.cpp @@ -78,7 +78,13 @@ static llvm::Constant *buildBlockDescriptor(CodeGenModule &CGM, ASTContext &C = CGM.getContext(); llvm::Type *ulong = CGM.getTypes().ConvertType(C.UnsignedLongTy); - llvm::Type *i8p = CGM.getTypes().ConvertType(C.VoidPtrTy); + llvm::Type *i8p = NULL; + if (CGM.getLangOpts().OpenCL) + i8p = + llvm::Type::getInt8PtrTy( + CGM.getLLVMContext(), C.getTargetAddressSpace(LangAS::opencl_constant)); + else + i8p = CGM.getTypes().ConvertType(C.VoidPtrTy); SmallVector<llvm::Constant*, 6> elements; |

