diff --git a/compiler-rt/lib/orc/executor_address.h b/compiler-rt/lib/orc/executor_address.h index e541d13627bb..fcdbe5e1edda 100644 --- a/compiler-rt/lib/orc/executor_address.h +++ b/compiler-rt/lib/orc/executor_address.h @@ -40,7 +40,7 @@ private: class ExecutorAddr { public: /// A wrap/unwrap function that leaves pointers unmodified. - template using rawPtr = __orc_rt::identity; + template using rawPtr = __orc_rt::identity; /// Default wrap function to use on this host. template using defaultWrap = rawPtr; @@ -82,14 +82,14 @@ public: explicit ExecutorAddr(uint64_t Addr) : Addr(Addr) {} /// Create an ExecutorAddr from the given pointer. - template > + template > static ExecutorAddr fromPtr(T *Ptr, UnwrapFn &&Unwrap = UnwrapFn()) { return ExecutorAddr( static_cast(reinterpret_cast(Unwrap(Ptr)))); } /// Cast this ExecutorAddr to a pointer of the given type. - template > + template >> std::enable_if_t::value, T> toPtr(WrapFn &&Wrap = WrapFn()) const { uintptr_t IntPtr = static_cast(Addr); @@ -98,7 +98,7 @@ public: } /// Cast this ExecutorAddr to a pointer of the given function type. - template > + template > std::enable_if_t::value, T *> toPtr(WrapFn &&Wrap = WrapFn()) const { uintptr_t IntPtr = static_cast(Addr); diff --git a/llvm/include/llvm/ExecutionEngine/Orc/Shared/ExecutorAddress.h b/llvm/include/llvm/ExecutionEngine/Orc/Shared/ExecutorAddress.h index cb0c0a4d8139..f6673b18cb5a 100644 --- a/llvm/include/llvm/ExecutionEngine/Orc/Shared/ExecutorAddress.h +++ b/llvm/include/llvm/ExecutionEngine/Orc/Shared/ExecutorAddress.h @@ -31,7 +31,7 @@ using ExecutorAddrDiff = uint64_t; class ExecutorAddr { public: /// A wrap/unwrap function that leaves pointers unmodified. - template using rawPtr = llvm::identity; + template using rawPtr = llvm::identity; /// Default wrap function to use on this host. template using defaultWrap = rawPtr; @@ -76,7 +76,7 @@ public: /// Create an ExecutorAddr from the given pointer. /// Warning: This should only be used when JITing in-process. - template > + template > static ExecutorAddr fromPtr(T *Ptr, UnwrapFn &&Unwrap = UnwrapFn()) { return ExecutorAddr( static_cast(reinterpret_cast(Unwrap(Ptr)))); @@ -84,7 +84,7 @@ public: /// Cast this ExecutorAddr to a pointer of the given type. /// Warning: This should only be used when JITing in-process. - template > + template >> std::enable_if_t::value, T> toPtr(WrapFn &&Wrap = WrapFn()) const { uintptr_t IntPtr = static_cast(Addr); @@ -94,7 +94,7 @@ public: /// Cast this ExecutorAddr to a pointer of the given function type. /// Warning: This should only be used when JITing in-process. - template > + template > std::enable_if_t::value, T *> toPtr(WrapFn &&Wrap = WrapFn()) const { uintptr_t IntPtr = static_cast(Addr);