Commit 87894ca1 by Ben Clayton

Reactor/Traits: Swap the naming of CToReactorPtr and CToReactorPtrT.

This should have been done as part of 51f08312, but it got missed. Bug: b/143479561 Change-Id: I16d802e753989576ade007c031f11bc5ab351d32 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/38390Tested-by: 's avatarBen Clayton <bclayton@google.com> Kokoro-Presubmit: kokoro <noreply+kokoro@google.com> Reviewed-by: 's avatarAlexis Hétu <sugoi@google.com>
parent a9f511bc
...@@ -81,28 +81,28 @@ namespace rr ...@@ -81,28 +81,28 @@ namespace rr
// TODO: Long has no constructor that takes a uint64_t // TODO: Long has no constructor that takes a uint64_t
template<> struct CToReactor<uint64_t> { using type = Long; /* static Long cast(uint64_t); */ }; template<> struct CToReactor<uint64_t> { using type = Long; /* static Long cast(uint64_t); */ };
// CToReactorPtrT<T>::type resolves to the corresponding Reactor Pointer<> // CToReactorPtr<T>::type resolves to the corresponding Reactor Pointer<>
// type for T*. // type for T*.
// For T types that have a CToReactorT<> specialization, // For T types that have a CToReactorT<> specialization,
// CToReactorPtrT<T>::type resolves to Pointer< CToReactorT<T> >, otherwise // CToReactorPtr<T>::type resolves to Pointer< CToReactorT<T> >, otherwise
// CToReactorPtrT<T>::type resolves to Pointer<Byte>. // CToReactorPtr<T>::type resolves to Pointer<Byte>.
template<typename T, typename ENABLE = void> struct CToReactorPtrT template<typename T, typename ENABLE = void> struct CToReactorPtr
{ {
using type = Pointer<Byte>; using type = Pointer<Byte>;
static inline type cast(const T* v); // implemented in Traits.inl static inline type cast(const T* v); // implemented in Traits.inl
}; };
// CToReactorPtrT specialization for T types that have a CToReactorT<> // CToReactorPtr specialization for T types that have a CToReactorT<>
// specialization. // specialization.
template<typename T> struct CToReactorPtrT<T, typename std::enable_if< IsDefined< CToReactorT<T> >::value>::type > template<typename T> struct CToReactorPtr<T, typename std::enable_if< IsDefined< CToReactorT<T> >::value>::type >
{ {
using type = Pointer< CToReactorT<T> >; using type = Pointer< CToReactorT<T> >;
static inline type cast(const T* v); // implemented in Traits.inl static inline type cast(const T* v); // implemented in Traits.inl
}; };
// CToReactorPtrT specialization for void*. // CToReactorPtr specialization for void*.
// Maps to Pointer<Byte> instead of Pointer<Void>. // Maps to Pointer<Byte> instead of Pointer<Void>.
template<> struct CToReactorPtrT<void, void> template<> struct CToReactorPtr<void, void>
{ {
using type = Pointer<Byte>; using type = Pointer<Byte>;
static inline type cast(const void* v); // implemented in Traits.inl static inline type cast(const void* v); // implemented in Traits.inl
...@@ -112,13 +112,13 @@ namespace rr ...@@ -112,13 +112,13 @@ namespace rr
// Maps to Pointer<Byte>. // Maps to Pointer<Byte>.
// Drops the 'const' qualifier from the cast() method to avoid warnings // Drops the 'const' qualifier from the cast() method to avoid warnings
// about const having no meaning for function types. // about const having no meaning for function types.
template<typename T> struct CToReactorPtrT<T, typename std::enable_if< std::is_function<T>::value >::type > template<typename T> struct CToReactorPtr<T, typename std::enable_if< std::is_function<T>::value >::type >
{ {
using type = Pointer<Byte>; using type = Pointer<Byte>;
static inline type cast(T* v); // implemented in Traits.inl static inline type cast(T* v); // implemented in Traits.inl
}; };
template<typename T> using CToReactorPtr = typename CToReactorPtrT<T>::type; template<typename T> using CToReactorPtrT = typename CToReactorPtr<T>::type;
// CToReactor specialization for pointer types. // CToReactor specialization for pointer types.
// For T types that have a CToReactorT<> specialization, // For T types that have a CToReactorT<> specialization,
...@@ -128,7 +128,7 @@ namespace rr ...@@ -128,7 +128,7 @@ namespace rr
struct CToReactor<T, typename std::enable_if<std::is_pointer<T>::value>::type> struct CToReactor<T, typename std::enable_if<std::is_pointer<T>::value>::type>
{ {
using elem = typename std::remove_pointer<T>::type; using elem = typename std::remove_pointer<T>::type;
using type = CToReactorPtr<elem>; using type = CToReactorPtrT<elem>;
static inline type cast(T v); // implemented in Traits.inl static inline type cast(T v); // implemented in Traits.inl
}; };
......
...@@ -17,25 +17,25 @@ ...@@ -17,25 +17,25 @@
namespace rr namespace rr
{ {
// Non-specialized implementation of CToReactorPtrT::cast() defaults to // Non-specialized implementation of CToReactorPtr::cast() defaults to
// returning a ConstantPointer for v. // returning a ConstantPointer for v.
template<typename T, typename ENABLE> template<typename T, typename ENABLE>
Pointer<Byte> CToReactorPtrT<T, ENABLE>::cast(const T* v) Pointer<Byte> CToReactorPtr<T, ENABLE>::cast(const T* v)
{ {
return ConstantPointer(v); return ConstantPointer(v);
} }
// CToReactorPtrT specialization for T types that have a CToReactorT<> // CToReactorPtr specialization for T types that have a CToReactorT<>
// specialization. // specialization.
template<typename T> template<typename T>
Pointer<CToReactorT<T>> Pointer<CToReactorT<T>>
CToReactorPtrT<T, typename std::enable_if< IsDefined< CToReactorT<T> >::value>::type >::cast(const T* v) CToReactorPtr<T, typename std::enable_if< IsDefined< CToReactorT<T> >::value>::type >::cast(const T* v)
{ {
return type(v); return type(v);
} }
// CToReactorPtrT specialization for void*. // CToReactorPtr specialization for void*.
Pointer<Byte> CToReactorPtrT<void, void>::cast(const void* v) Pointer<Byte> CToReactorPtr<void, void>::cast(const void* v)
{ {
return ConstantPointer(v); return ConstantPointer(v);
} }
...@@ -43,17 +43,17 @@ namespace rr ...@@ -43,17 +43,17 @@ namespace rr
// CToReactorPtrT specialization for function pointer types. // CToReactorPtrT specialization for function pointer types.
template<typename T> template<typename T>
Pointer<Byte> Pointer<Byte>
CToReactorPtrT<T, typename std::enable_if< std::is_function<T>::value >::type>::cast(T* v) CToReactorPtr<T, typename std::enable_if< std::is_function<T>::value >::type>::cast(T* v)
{ {
return ConstantPointer(v); return ConstantPointer(v);
} }
// CToReactor specialization for pointer types. // CToReactor specialization for pointer types.
template<typename T> template<typename T>
CToReactorPtr<typename std::remove_pointer<T>::type> CToReactorPtrT<typename std::remove_pointer<T>::type>
CToReactor<T, typename std::enable_if<std::is_pointer<T>::value>::type>::cast(T v) CToReactor<T, typename std::enable_if<std::is_pointer<T>::value>::type>::cast(T v)
{ {
return CToReactorPtrT<elem>::cast(v); return CToReactorPtr<elem>::cast(v);
} }
// CToReactor specialization for enum types. // CToReactor specialization for enum types.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment