diff --git a/llvm/lib/ExecutionEngine/JITLink/JITLinkGeneric.cpp b/llvm/lib/ExecutionEngine/JITLink/JITLinkGeneric.cpp index 17050b0a5248..c160f9d4e7f0 100644 --- a/llvm/lib/ExecutionEngine/JITLink/JITLinkGeneric.cpp +++ b/llvm/lib/ExecutionEngine/JITLink/JITLinkGeneric.cpp @@ -54,11 +54,7 @@ void JITLinkerBase::linkPhase1(std::unique_ptr Self) { Ctx->getMemoryManager().allocate( Ctx->getJITLinkDylib(), *G, [S = std::move(Self)](AllocResult AR) mutable { - // FIXME: Once MSVC implements c++17 order of evaluation rules for calls - // this can be simplified to - // S->linkPhase2(std::move(S), std::move(AR)); - auto *TmpSelf = S.get(); - TmpSelf->linkPhase2(std::move(S), std::move(AR)); + S->linkPhase2(std::move(S), std::move(AR)); }); } @@ -95,10 +91,7 @@ void JITLinkerBase::linkPhase2(std::unique_ptr Self, dbgs() << "No external symbols for " << G->getName() << ". Proceeding immediately with link phase 3.\n"; }); - // FIXME: Once MSVC implements c++17 order of evaluation rules for calls - // this can be simplified. See below. - auto &TmpSelf = *Self; - TmpSelf.linkPhase3(std::move(Self), AsyncLookupResult()); + Self->linkPhase3(std::move(Self), AsyncLookupResult()); return; } @@ -108,22 +101,11 @@ void JITLinkerBase::linkPhase2(std::unique_ptr Self, << " (may trigger materialization/linking of other graphs)...\n"; }); - // 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 MSVC implements c++17 order of evaluation rules for calls this - // can be simplified to: - // - // Ctx->lookup(std::move(UnresolvedExternals), - // [Self=std::move(Self)](Expected Result) { - // Self->linkPhase3(std::move(Self), std::move(Result)); - // }); Ctx->lookup(std::move(ExternalSymbols), createLookupContinuation( [S = std::move(Self)]( Expected LookupResult) mutable { - auto &TmpSelf = *S; - TmpSelf.linkPhase3(std::move(S), std::move(LookupResult)); + S->linkPhase3(std::move(S), std::move(LookupResult)); })); } @@ -171,11 +153,7 @@ void JITLinkerBase::linkPhase3(std::unique_ptr Self, } Alloc->finalize([S = std::move(Self)](FinalizeResult FR) mutable { - // FIXME: Once MSVC implements c++17 order of evaluation rules for calls - // this can be simplified to - // S->linkPhase2(std::move(S), std::move(AR)); - auto *TmpSelf = S.get(); - TmpSelf->linkPhase4(std::move(S), std::move(FR)); + S->linkPhase4(std::move(S), std::move(FR)); }); } diff --git a/llvm/lib/ExecutionEngine/JITLink/JITLinkGeneric.h b/llvm/lib/ExecutionEngine/JITLink/JITLinkGeneric.h index 0bf714d6fcdf..4892a394d9e5 100644 --- a/llvm/lib/ExecutionEngine/JITLink/JITLinkGeneric.h +++ b/llvm/lib/ExecutionEngine/JITLink/JITLinkGeneric.h @@ -116,12 +116,10 @@ public: // Ownership of the linker is passed into the linker's doLink function to // allow it to be passed on to async continuations. // - // FIXME: Remove LTmp once we have c++17. // C++17 sequencing rules guarantee that function name expressions are - // sequenced before arguments, so L->linkPhase1(std::move(L), ...) will be - // well formed. - auto <mp = *L; - LTmp.linkPhase1(std::move(L)); + // sequenced before arguments, so L->linkPhase1(std::move(L)) is well + // formed. + L->linkPhase1(std::move(L)); } private: