[llvm] r361203 - [ORC] fix use-after-move. NFC
Nick Desaulniers via llvm-commits
llvm-commits at lists.llvm.org
Mon May 20 15:17:43 PDT 2019
Author: nickdesaulniers
Date: Mon May 20 15:17:43 2019
New Revision: 361203
URL: http://llvm.org/viewvc/llvm-project?rev=361203&view=rev
Log:
[ORC] fix use-after-move. NFC
Summary:
scan-build flagged a potential use-after-move in debug builds. It's not
safe that a moved from value contains anything but garbage. Manually
DRY up these repeated expressions.
Reviewers: lhames
Reviewed By: lhames
Subscribers: hiraditya, llvm-commits, srhines
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D62112
Modified:
llvm/trunk/lib/ExecutionEngine/Orc/Layer.cpp
Modified: llvm/trunk/lib/ExecutionEngine/Orc/Layer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/Orc/Layer.cpp?rev=361203&r1=361202&r2=361203&view=diff
==============================================================================
--- llvm/trunk/lib/ExecutionEngine/Orc/Layer.cpp (original)
+++ llvm/trunk/lib/ExecutionEngine/Orc/Layer.cpp Mon May 20 15:17:43 2019
@@ -87,17 +87,15 @@ void BasicIRLayerMaterializationUnit::ma
#ifndef NDEBUG
auto &ES = R.getTargetJITDylib().getExecutionSession();
+ auto &N = R.getTargetJITDylib().getName();
#endif // NDEBUG
auto Lock = TSM.getContextLock();
- LLVM_DEBUG(ES.runSessionLocked([&]() {
- dbgs() << "Emitting, for " << R.getTargetJITDylib().getName() << ", "
- << *this << "\n";
- }););
+ LLVM_DEBUG(ES.runSessionLocked(
+ [&]() { dbgs() << "Emitting, for " << N << ", " << *this << "\n"; }););
L.emit(std::move(R), std::move(TSM));
LLVM_DEBUG(ES.runSessionLocked([&]() {
- dbgs() << "Finished emitting, for " << R.getTargetJITDylib().getName()
- << ", " << *this << "\n";
+ dbgs() << "Finished emitting, for " << N << ", " << *this << "\n";
}););
}
More information about the llvm-commits
mailing list