Add a SubclassOptionalData field to Value. See the doxygen comment for
authorDan Gohman <gohman@apple.com>
Fri, 17 Jul 2009 17:16:59 +0000 (17:16 +0000)
committerDan Gohman <gohman@apple.com>
Fri, 17 Jul 2009 17:16:59 +0000 (17:16 +0000)
details.

llvm-svn: 76189

llvm/include/llvm/Value.h
llvm/lib/VMCore/Value.cpp

index a38d8cb8d9846a895a210827b7ec217575453f37..35a30a81d5e6fd84fbd7c72535ca60220b068c8f 100644 (file)
@@ -62,6 +62,12 @@ class Value {
   const unsigned char SubclassID;   // Subclass identifier (for isa/dyn_cast)
   unsigned char HasValueHandle : 1; // Has a ValueHandle pointing to this?
 protected:
+  /// SubclassOptionalData - This member is similar to SubclassData, however it
+  /// is for holding information which may be used to aid optimization, but
+  /// which may be cleared to zero without affecting conservative
+  /// interpretation.
+  unsigned char SubclassOptionalData : 7;
+
   /// SubclassData - This member is defined by this class, but is not used for
   /// anything.  Subclasses can use it to hold whatever state they find useful.
   /// This field is initialized to zero by the ctor.
index f3d561fe39bf7ae2b37dd9736bb8e53c5fb49395..b35ad50798409a8a17da4a9a8f87fd18cbe5a725 100644 (file)
@@ -40,7 +40,8 @@ static inline const Type *checkType(const Type *Ty) {
 }
 
 Value::Value(const Type *ty, unsigned scid)
-  : SubclassID(scid), HasValueHandle(0), SubclassData(0), VTy(checkType(ty)),
+  : SubclassID(scid), HasValueHandle(0), SubclassOptionalData(0),
+    SubclassData(0), VTy(checkType(ty)),
     UseList(0), Name(0) {
   if (isa<CallInst>(this) || isa<InvokeInst>(this))
     assert((VTy->isFirstClassType() || VTy == Type::VoidTy ||