aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CGCall.cpp
diff options
context:
space:
mode:
authorHsiangkai Wang <kai.wang@sifive.com>2021-05-20 10:22:08 +0800
committerHsiangkai Wang <kai.wang@sifive.com>2021-06-07 23:30:13 +0800
commit2b13ff69794680ea0764e516f5b69b80219771b7 (patch)
treee54b5c3f83f102cc4047b8d3f4e625b58d7eeb12 /clang/lib/CodeGen/CGCall.cpp
parentcfcdebaf323575952ef8326c32e47d351b79ee37 (diff)
downloadllvm-2b13ff69794680ea0764e516f5b69b80219771b7.zip
llvm-2b13ff69794680ea0764e516f5b69b80219771b7.tar.gz
llvm-2b13ff69794680ea0764e516f5b69b80219771b7.tar.bz2
[Clang][CodeGen] Set the size of llvm.lifetime to unknown for scalable types.
If the memory object is scalable type, we do not know the exact size of it at compile time. Set the size of lifetime marker to unknown if the object is scalable one. Differential Revision: https://reviews.llvm.org/D102822
Diffstat (limited to 'clang/lib/CodeGen/CGCall.cpp')
-rw-r--r--clang/lib/CodeGen/CGCall.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CGCall.cpp b/clang/lib/CodeGen/CGCall.cpp
index beb6b0f..1cd972f 100644
--- a/clang/lib/CodeGen/CGCall.cpp
+++ b/clang/lib/CodeGen/CGCall.cpp
@@ -4683,7 +4683,7 @@ RValue CodeGenFunction::EmitCall(const CGFunctionInfo &CallInfo,
} else {
SRetPtr = CreateMemTemp(RetTy, "tmp", &SRetAlloca);
if (HaveInsertPoint() && ReturnValue.isUnused()) {
- uint64_t size =
+ llvm::TypeSize size =
CGM.getDataLayout().getTypeAllocSize(ConvertTypeForMem(RetTy));
UnusedReturnSizePtr = EmitLifetimeStart(size, SRetAlloca.getPointer());
}
@@ -4844,7 +4844,7 @@ RValue CodeGenFunction::EmitCall(const CGFunctionInfo &CallInfo,
IRCallArgs[FirstIRArg] = AI.getPointer();
// Emit lifetime markers for the temporary alloca.
- uint64_t ByvalTempElementSize =
+ llvm::TypeSize ByvalTempElementSize =
CGM.getDataLayout().getTypeAllocSize(AI.getElementType());
llvm::Value *LifetimeSize =
EmitLifetimeStart(ByvalTempElementSize, AI.getPointer());