From: Chris Lattner Date: Sun, 29 Mar 2009 05:45:43 +0000 (+0000) Subject: Value* only has 2 bits free as well. X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=aab3d88bc481fdc3081d2280dab4f7efd7e74a61;p=oota-llvm.git Value* only has 2 bits free as well. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67984 91177308-0d34-0410-b5e6-96231b3b80d8 --- 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