diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2019-09-13 11:35:33 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2019-09-13 11:35:33 +0000 |
commit | ce74c3b19f5b60d427977f21e506c26a3f40bd7f (patch) | |
tree | 79a6eec3634ad4ca96d1dd881f950093f896ebe9 /llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp | |
parent | 0d9a201e2624998922f825ebbe01aae0cce4bbd5 (diff) | |
download | bcm5719-llvm-ce74c3b19f5b60d427977f21e506c26a3f40bd7f.tar.gz bcm5719-llvm-ce74c3b19f5b60d427977f21e506c26a3f40bd7f.zip |
[Orc] Address the remaining move-capture FIXMEs
This required spreading unique_function a bit more, which I think is a
good thing.
llvm-svn: 371843
Diffstat (limited to 'llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp')
-rw-r--r-- | llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp b/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp index e000b7b227e..18c74172a07 100644 --- a/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp +++ b/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp @@ -1180,17 +1180,15 @@ Error RuntimeDyldImpl::resolveExternalSymbols() { } void RuntimeDyldImpl::finalizeAsync( - std::unique_ptr<RuntimeDyldImpl> This, std::function<void(Error)> OnEmitted, + std::unique_ptr<RuntimeDyldImpl> This, + unique_function<void(Error)> OnEmitted, std::unique_ptr<MemoryBuffer> UnderlyingBuffer) { - // FIXME: Move-capture OnRelocsApplied and UnderlyingBuffer once we have - // c++14. - auto SharedUnderlyingBuffer = - std::shared_ptr<MemoryBuffer>(std::move(UnderlyingBuffer)); auto SharedThis = std::shared_ptr<RuntimeDyldImpl>(std::move(This)); auto PostResolveContinuation = - [SharedThis, OnEmitted, SharedUnderlyingBuffer]( - Expected<JITSymbolResolver::LookupResult> Result) { + [SharedThis, OnEmitted = std::move(OnEmitted), + UnderlyingBuffer = std::move(UnderlyingBuffer)]( + Expected<JITSymbolResolver::LookupResult> Result) mutable { if (!Result) { OnEmitted(Result.takeError()); return; @@ -1224,7 +1222,7 @@ void RuntimeDyldImpl::finalizeAsync( } if (!Symbols.empty()) { - SharedThis->Resolver.lookup(Symbols, PostResolveContinuation); + SharedThis->Resolver.lookup(Symbols, std::move(PostResolveContinuation)); } else PostResolveContinuation(std::map<StringRef, JITEvaluatedSymbol>()); } @@ -1400,11 +1398,11 @@ void jitLinkForORC(object::ObjectFile &Obj, std::unique_ptr<MemoryBuffer> UnderlyingBuffer, RuntimeDyld::MemoryManager &MemMgr, JITSymbolResolver &Resolver, bool ProcessAllSections, - std::function<Error( + unique_function<Error( std::unique_ptr<RuntimeDyld::LoadedObjectInfo> LoadedObj, std::map<StringRef, JITEvaluatedSymbol>)> OnLoaded, - std::function<void(Error)> OnEmitted) { + unique_function<void(Error)> OnEmitted) { RuntimeDyld RTDyld(MemMgr, Resolver); RTDyld.setProcessAllSections(ProcessAllSections); |