From d36a715b24ce9e3dbb05fd20c1259a3a788d7f14 Mon Sep 17 00:00:00 2001 From: Nekotekina Date: Fri, 24 Dec 2021 17:37:28 +0300 Subject: [PATCH] Disable built_function on __APPLE__ Workaround for #11287 --- Utilities/JIT.h | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/Utilities/JIT.h b/Utilities/JIT.h index 85454c07e1..027130d8aa 100644 --- a/Utilities/JIT.h +++ b/Utilities/JIT.h @@ -198,6 +198,35 @@ inline FT build_function_asm(F&& builder) return result; } +#ifdef __APPLE__ +template +class built_function +{ + FT m_func; + +public: + built_function(const built_function&) = delete; + + built_function& operator=(const built_function&) = delete; + + template + built_function(F&& builder) + : m_func(ensure(build_function_asm(std::forward(builder)))) + { + } + + operator FT() const noexcept + { + return m_func; + } + + template + auto operator()(Args&&... args) const noexcept + { + return m_func(std::forward(args)...); + } +}; +#else template class built_function { @@ -254,6 +283,7 @@ public: return FT(+m_data)(std::forward(args)...); } }; +#endif #ifdef LLVM_AVAILABLE