diff options
Diffstat (limited to 'include/llvm/ExecutionEngine/Orc/LambdaResolver.h')
-rw-r--r-- | include/llvm/ExecutionEngine/Orc/LambdaResolver.h | 37 |
1 files changed, 18 insertions, 19 deletions
diff --git a/include/llvm/ExecutionEngine/Orc/LambdaResolver.h b/include/llvm/ExecutionEngine/Orc/LambdaResolver.h index faa23658524f..a42b9d5c29d1 100644 --- a/include/llvm/ExecutionEngine/Orc/LambdaResolver.h +++ b/include/llvm/ExecutionEngine/Orc/LambdaResolver.h @@ -18,42 +18,41 @@ #include "llvm/ADT/STLExtras.h" #include "llvm/ExecutionEngine/RuntimeDyld.h" #include <memory> -#include <vector> namespace llvm { namespace orc { -template <typename ExternalLookupFtorT, typename DylibLookupFtorT> +template <typename DylibLookupFtorT, typename ExternalLookupFtorT> class LambdaResolver : public RuntimeDyld::SymbolResolver { public: - LambdaResolver(ExternalLookupFtorT ExternalLookupFtor, - DylibLookupFtorT DylibLookupFtor) - : ExternalLookupFtor(ExternalLookupFtor), - DylibLookupFtor(DylibLookupFtor) {} - - RuntimeDyld::SymbolInfo findSymbol(const std::string &Name) final { - return ExternalLookupFtor(Name); - } + LambdaResolver(DylibLookupFtorT DylibLookupFtor, + ExternalLookupFtorT ExternalLookupFtor) + : DylibLookupFtor(DylibLookupFtor), + ExternalLookupFtor(ExternalLookupFtor) {} RuntimeDyld::SymbolInfo findSymbolInLogicalDylib(const std::string &Name) final { return DylibLookupFtor(Name); } + RuntimeDyld::SymbolInfo findSymbol(const std::string &Name) final { + return ExternalLookupFtor(Name); + } + private: - ExternalLookupFtorT ExternalLookupFtor; DylibLookupFtorT DylibLookupFtor; + ExternalLookupFtorT ExternalLookupFtor; }; -template <typename ExternalLookupFtorT, - typename DylibLookupFtorT> -std::unique_ptr<LambdaResolver<ExternalLookupFtorT, DylibLookupFtorT>> -createLambdaResolver(ExternalLookupFtorT ExternalLookupFtor, - DylibLookupFtorT DylibLookupFtor) { - typedef LambdaResolver<ExternalLookupFtorT, DylibLookupFtorT> LR; - return make_unique<LR>(std::move(ExternalLookupFtor), - std::move(DylibLookupFtor)); +template <typename DylibLookupFtorT, + typename ExternalLookupFtorT> +std::unique_ptr<LambdaResolver<DylibLookupFtorT, ExternalLookupFtorT>> +createLambdaResolver(DylibLookupFtorT DylibLookupFtor, + ExternalLookupFtorT ExternalLookupFtor) { + typedef LambdaResolver<DylibLookupFtorT, ExternalLookupFtorT> LR; + return make_unique<LR>(std::move(DylibLookupFtor), + std::move(ExternalLookupFtor)); } } // End namespace orc. |