diff options
Diffstat (limited to 'llvm/include/llvm/ExecutionEngine/Orc/ThreadSafeModule.h')
-rw-r--r-- | llvm/include/llvm/ExecutionEngine/Orc/ThreadSafeModule.h | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/ThreadSafeModule.h b/llvm/include/llvm/ExecutionEngine/Orc/ThreadSafeModule.h index 2347faed37a2..58c96737e580 100644 --- a/llvm/include/llvm/ExecutionEngine/Orc/ThreadSafeModule.h +++ b/llvm/include/llvm/ExecutionEngine/Orc/ThreadSafeModule.h @@ -130,8 +130,7 @@ public: /// Locks the associated ThreadSafeContext and calls the given function /// on the contained Module. - template <typename Func> - auto withModuleDo(Func &&F) -> decltype(F(std::declval<Module &>())) { + template <typename Func> decltype(auto) withModuleDo(Func &&F) { assert(M && "Can not call on null module"); auto Lock = TSCtx.getLock(); return F(*M); @@ -139,9 +138,7 @@ public: /// Locks the associated ThreadSafeContext and calls the given function /// on the contained Module. - template <typename Func> - auto withModuleDo(Func &&F) const - -> decltype(F(std::declval<const Module &>())) { + template <typename Func> decltype(auto) withModuleDo(Func &&F) const { auto Lock = TSCtx.getLock(); return F(*M); } |