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
This commit is contained in:
Chris Lattner 2009-03-29 05:45:43 +00:00
parent e30173ac33
commit aab3d88bc4

View File

@ -303,6 +303,19 @@ template <> inline bool isa_impl<GlobalValue, Value>(const Value &Val) {
return isa<GlobalVariable>(Val) || isa<Function>(Val) ||
isa<GlobalAlias>(Val);
}
// Value* is only 4-byte aligned.
template<>
class PointerLikeTypeTraits<Value*> {
typedef Value* PT;
public:
static inline void *getAsVoidPointer(PT P) { return P; }
static inline PT getFromVoidPointer(void *P) {
return static_cast<PT>(P);
}
enum { NumLowBitsAvailable = 2 };
};
} // End llvm namespace