[llvm] 6ea5bf4 - [JITLink] Fix some C++17 related fixmes.
Lang Hames via llvm-commits
llvm-commits at lists.llvm.org
Sun Aug 7 09:41:32 PDT 2022
Author: Lang Hames
Date: 2022-08-07T09:37:14-07:00
New Revision: 6ea5bf436a983ea9e16a5fe7534c87beca0a61b7
URL: https://github.com/llvm/llvm-project/commit/6ea5bf436a983ea9e16a5fe7534c87beca0a61b7
DIFF: https://github.com/llvm/llvm-project/commit/6ea5bf436a983ea9e16a5fe7534c87beca0a61b7.diff
LOG: [JITLink] Fix some C++17 related fixmes.
Added:
Modified:
llvm/lib/ExecutionEngine/JITLink/JITLinkGeneric.cpp
Removed:
################################################################################
diff --git a/llvm/lib/ExecutionEngine/JITLink/JITLinkGeneric.cpp b/llvm/lib/ExecutionEngine/JITLink/JITLinkGeneric.cpp
index 6d321a0808296..477f21dacfa30 100644
--- a/llvm/lib/ExecutionEngine/JITLink/JITLinkGeneric.cpp
+++ b/llvm/lib/ExecutionEngine/JITLink/JITLinkGeneric.cpp
@@ -51,8 +51,7 @@ void JITLinkerBase::linkPhase1(std::unique_ptr<JITLinkerBase> Self) {
Ctx->getMemoryManager().allocate(
Ctx->getJITLinkDylib(), *G,
[S = std::move(Self)](AllocResult AR) mutable {
- auto *TmpSelf = S.get();
- TmpSelf->linkPhase2(std::move(S), std::move(AR));
+ S->linkPhase2(std::move(S), std::move(AR));
});
}
@@ -88,10 +87,7 @@ void JITLinkerBase::linkPhase2(std::unique_ptr<JITLinkerBase> Self,
dbgs() << "No external symbols for " << G->getName()
<< ". Proceeding immediately with link phase 3.\n";
});
- // FIXME: Once callee expressions are defined to be sequenced before
- // argument expressions (c++17) we can simplify this. See below.
- auto &TmpSelf = *Self;
- TmpSelf.linkPhase3(std::move(Self), AsyncLookupResult());
+ Self->linkPhase3(std::move(Self), AsyncLookupResult());
return;
}
@@ -103,20 +99,11 @@ void JITLinkerBase::linkPhase2(std::unique_ptr<JITLinkerBase> Self,
// We're about to hand off ownership of ourself to the continuation. Grab a
// pointer to the context so that we can call it to initiate the lookup.
- //
- // FIXME: Once callee expressions are defined to be sequenced before argument
- // expressions (c++17) we can simplify all this to:
- //
- // Ctx->lookup(std::move(UnresolvedExternals),
- // [Self=std::move(Self)](Expected<AsyncLookupResult> Result) {
- // Self->linkPhase3(std::move(Self), std::move(Result));
- // });
Ctx->lookup(std::move(ExternalSymbols),
createLookupContinuation(
[S = std::move(Self)](
Expected<AsyncLookupResult> LookupResult) mutable {
- auto &TmpSelf = *S;
- TmpSelf.linkPhase3(std::move(S), std::move(LookupResult));
+ S->linkPhase3(std::move(S), std::move(LookupResult));
}));
}
@@ -161,8 +148,7 @@ void JITLinkerBase::linkPhase3(std::unique_ptr<JITLinkerBase> Self,
return abandonAllocAndBailOut(std::move(Self), std::move(Err));
Alloc->finalize([S = std::move(Self)](FinalizeResult FR) mutable {
- auto *TmpSelf = S.get();
- TmpSelf->linkPhase4(std::move(S), std::move(FR));
+ S->linkPhase4(std::move(S), std::move(FR));
});
}
More information about the llvm-commits
mailing list