1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 11:02:59 +02:00

[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

llvm-svn: 361203
This commit is contained in:
Nick Desaulniers 2019-05-20 22:17:43 +00:00
parent 2df3daaca8
commit 321e6d2886

View File

@ -87,17 +87,15 @@ void BasicIRLayerMaterializationUnit::materialize(
#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";
}););
}