diff options
| author | Chris Lattner <sabre@nondot.org> | 2009-03-31 21:28:39 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2009-03-31 21:28:39 +0000 |
| commit | e756f15703cb8333aaae1559da25cb7f7f3aec8c (patch) | |
| tree | 13de7a43fa4befce3c946b795d48f1dea8b3846e /llvm/include | |
| parent | 77684ead4bd1b97bb33b65062fcc5b80a006ea58 (diff) | |
| download | bcm5719-llvm-e756f15703cb8333aaae1559da25cb7f7f3aec8c.tar.gz bcm5719-llvm-e756f15703cb8333aaae1559da25cb7f7f3aec8c.zip | |
teach PointerLikeTypeTraits that all pointers to pointers may only be 4-byte aligned.
llvm-svn: 68147
Diffstat (limited to 'llvm/include')
| -rw-r--r-- | llvm/include/llvm/Support/PointerLikeTypeTraits.h | 14 | ||||
| -rw-r--r-- | llvm/include/llvm/Use.h | 11 |
2 files changed, 14 insertions, 11 deletions
diff --git a/llvm/include/llvm/Support/PointerLikeTypeTraits.h b/llvm/include/llvm/Support/PointerLikeTypeTraits.h index c5f79ccb835..226dacf3611 100644 --- a/llvm/include/llvm/Support/PointerLikeTypeTraits.h +++ b/llvm/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> { diff --git a/llvm/include/llvm/Use.h b/llvm/include/llvm/Use.h index 53df699e703..32cdd1b95dd 100644 --- a/llvm/include/llvm/Use.h +++ b/llvm/include/llvm/Use.h @@ -29,17 +29,6 @@ class Use; /// Tag - generic tag type for (at least 32 bit) pointers enum Tag { noTag, tagOne, tagTwo, tagThree }; -// Use** is only 4-byte aligned. -template<> -class PointerLikeTypeTraits<Use**> { -public: - static inline void *getAsVoidPointer(Use** P) { return P; } - static inline Use **getFromVoidPointer(void *P) { - return static_cast<Use**>(P); - } - enum { NumLowBitsAvailable = 2 }; -}; - //===----------------------------------------------------------------------===// // Use Class //===----------------------------------------------------------------------===// |

