diff options
author | Yaxun Liu <Yaxun.Liu@amd.com> | 2016-08-19 05:17:25 +0000 |
---|---|---|
committer | Yaxun Liu <Yaxun.Liu@amd.com> | 2016-08-19 05:17:25 +0000 |
commit | 26f7566ff871cf249f3c4d077afeb79ab2eef670 (patch) | |
tree | 20f76331f177082a343d018d605061e2378a79e3 /clang/lib/CodeGen/CodeGenModule.cpp | |
parent | d6c7036e42fea391b46841d91c1de38c5ccd477d (diff) | |
download | bcm5719-llvm-26f7566ff871cf249f3c4d077afeb79ab2eef670.tar.gz bcm5719-llvm-26f7566ff871cf249f3c4d077afeb79ab2eef670.zip |
Re-commit [OpenCL] AMDGCN: Fix size_t type
There was a premature cast to pointer type in emitPointerArithmetic which caused assertion in tests with assertion enabled.
llvm-svn: 279206
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r-- | clang/lib/CodeGen/CodeGenModule.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index 2dcccf4c6c8..1d74e4cd838 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/lib/CodeGen/CodeGenModule.cpp @@ -101,10 +101,13 @@ CodeGenModule::CodeGenModule(ASTContext &C, const HeaderSearchOptions &HSO, PointerWidthInBits = C.getTargetInfo().getPointerWidth(0); PointerAlignInBytes = C.toCharUnitsFromBits(C.getTargetInfo().getPointerAlign(0)).getQuantity(); + SizeSizeInBytes = + C.toCharUnitsFromBits(C.getTargetInfo().getMaxPointerWidth()).getQuantity(); IntAlignInBytes = C.toCharUnitsFromBits(C.getTargetInfo().getIntAlign()).getQuantity(); IntTy = llvm::IntegerType::get(LLVMContext, C.getTargetInfo().getIntWidth()); - IntPtrTy = llvm::IntegerType::get(LLVMContext, PointerWidthInBits); + IntPtrTy = llvm::IntegerType::get(LLVMContext, + C.getTargetInfo().getMaxPointerWidth()); Int8PtrTy = Int8Ty->getPointerTo(0); Int8PtrPtrTy = Int8PtrTy->getPointerTo(0); |