diff options
author | George Burgess IV <george.burgess.iv@gmail.com> | 2018-03-06 23:07:00 +0000 |
---|---|---|
committer | George Burgess IV <george.burgess.iv@gmail.com> | 2018-03-06 23:07:00 +0000 |
commit | 7e03f350e8ae93806b13cb32516a4d54515b794d (patch) | |
tree | 6bb8c478d9d30eaeca5c683d575c5b053f355012 /clang/lib | |
parent | e2fc88a2fe6522d47f5bc98af4caf256c27271d6 (diff) | |
download | bcm5719-llvm-7e03f350e8ae93806b13cb32516a4d54515b794d.tar.gz bcm5719-llvm-7e03f350e8ae93806b13cb32516a4d54515b794d.zip |
[CodeGen] Don't emit lifetime.end without lifetime.start
EmitLifetimeStart returns a non-null `size` pointer if it actually
emits a lifetime.start. Later in this function, we use `tempSize`'s
nullness to determine whether or not we should emit a lifetime.end.
llvm-svn: 326844
Diffstat (limited to 'clang/lib')
-rw-r--r-- | clang/lib/CodeGen/CGCall.cpp | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/clang/lib/CodeGen/CGCall.cpp b/clang/lib/CodeGen/CGCall.cpp index ebba2501cea..187697ee0b6 100644 --- a/clang/lib/CodeGen/CGCall.cpp +++ b/clang/lib/CodeGen/CGCall.cpp @@ -4010,13 +4010,11 @@ RValue CodeGenFunction::EmitCall(const CGFunctionInfo &CallInfo, auto scalarSize = CGM.getDataLayout().getTypeAllocSize(scalarType); auto scalarAlign = CGM.getDataLayout().getPrefTypeAlignment(scalarType); - tempSize = llvm::ConstantInt::get(CGM.Int64Ty, scalarSize); - // Materialize to a temporary. addr = CreateTempAlloca(RV.getScalarVal()->getType(), CharUnits::fromQuantity(std::max(layout->getAlignment(), scalarAlign))); - EmitLifetimeStart(scalarSize, addr.getPointer()); + tempSize = EmitLifetimeStart(scalarSize, addr.getPointer()); Builder.CreateStore(RV.getScalarVal(), addr); } |