[llvm-commits] [llvm] r67984 - /llvm/trunk/include/llvm/Value.h
Chris Lattner
sabre at nondot.org
Sat Mar 28 22:45:44 PDT 2009
Author: lattner
Date: Sun Mar 29 00:45:43 2009
New Revision: 67984
URL: http://llvm.org/viewvc/llvm-project?rev=67984&view=rev
Log:
Value* only has 2 bits free as well.
Modified:
llvm/trunk/include/llvm/Value.h
Modified: llvm/trunk/include/llvm/Value.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Value.h?rev=67984&r1=67983&r2=67984&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Value.h (original)
+++ llvm/trunk/include/llvm/Value.h Sun Mar 29 00:45:43 2009
@@ -303,6 +303,19 @@
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
More information about the llvm-commits
mailing list