diff options
Diffstat (limited to 'include/llvm/Support/PointerLikeTypeTraits.h')
-rw-r--r-- | include/llvm/Support/PointerLikeTypeTraits.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/include/llvm/Support/PointerLikeTypeTraits.h b/include/llvm/Support/PointerLikeTypeTraits.h index c5f79ccb83..226dacf361 100644 --- a/include/llvm/Support/PointerLikeTypeTraits.h +++ b/include/llvm/Support/PointerLikeTypeTraits.h @@ -58,6 +58,20 @@ public: enum { NumLowBitsAvailable = 3 }; }; +// Pointers to pointers are only 4-byte aligned on 32-bit systems. +template<typename T> +class PointerLikeTypeTraits<T**> { +public: + static inline void *getAsVoidPointer(T** P) { return P; } + static inline T **getFromVoidPointer(void *P) { + return static_cast<T**>(P); + } + enum { NumLowBitsAvailable = 2 }; +}; + + + + // Provide PointerLikeTypeTraits for uintptr_t. template<> class PointerLikeTypeTraits<uintptr_t> { |