Value* only has 2 bits free as well.
authorChris Lattner <sabre@nondot.org>
Sun, 29 Mar 2009 05:45:43 +0000 (05:45 +0000)
committerChris Lattner <sabre@nondot.org>
Sun, 29 Mar 2009 05:45:43 +0000 (05:45 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67984 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Value.h

index b6aa66b7055739e7b78b715e8d2a3a1b58300b88..5f2e35f0c5b4568bd70ff7245e453c0bd0f6854c 100644 (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