diff --git a/include/llvm/Value.h b/include/llvm/Value.h index b6aa66b7055..5f2e35f0c5b 100644 --- a/include/llvm/Value.h +++ b/include/llvm/Value.h @@ -303,6 +303,19 @@ template <> inline bool isa_impl(const Value &Val) { return isa(Val) || isa(Val) || isa(Val); } + + +// Value* is only 4-byte aligned. +template<> +class PointerLikeTypeTraits { + typedef Value* PT; +public: + static inline void *getAsVoidPointer(PT P) { return P; } + static inline PT getFromVoidPointer(void *P) { + return static_cast(P); + } + enum { NumLowBitsAvailable = 2 }; +}; } // End llvm namespace