diff options
author | Lang Hames <lhames@gmail.com> | 2022-08-07 08:58:08 -0700 |
---|---|---|
committer | Lang Hames <lhames@gmail.com> | 2022-08-07 09:37:14 -0700 |
commit | 6ea5bf436a983ea9e16a5fe7534c87beca0a61b7 (patch) | |
tree | 8852e7761898e0a6671ba654adec6ab45da794fa | |
parent | 1dcff823db9f4dd5c300507f679cdb2494287442 (diff) |
[JITLink] Fix some C++17 related fixmes.
-rw-r--r-- | llvm/lib/ExecutionEngine/JITLink/JITLinkGeneric.cpp | 22 |
1 files changed, 4 insertions, 18 deletions
diff --git a/llvm/lib/ExecutionEngine/JITLink/JITLinkGeneric.cpp b/llvm/lib/ExecutionEngine/JITLink/JITLinkGeneric.cpp index 6d321a080829..477f21dacfa3 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)); }); } |