X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=include%2Fllvm%2FValue.h;h=7e7b415ffdeed671b1ba2ec26cf13a283633a236;hb=4b938958bcc59586508bc9681e75c2e3f5164672;hp=86484bacb9232bc4ec83d1e4f7f09a3070a78175;hpb=d72513417d146b667685527bd3f24335d7a4bce9;p=oota-llvm.git diff --git a/include/llvm/Value.h b/include/llvm/Value.h index 86484bacb92..7e7b415ffde 100644 --- a/include/llvm/Value.h +++ b/include/llvm/Value.h @@ -36,7 +36,7 @@ class TypeSymbolTable; template class StringMapEntry; template class AssertingVH; -typedef StringMapEntry > ValueName; +typedef StringMapEntry ValueName; class raw_ostream; class AssemblyAnnotationWriter; class ValueHandleBase; @@ -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. @@ -140,6 +146,12 @@ public: // Only use when in type resolution situations! void uncheckedReplaceAllUsesWith(Value *V); + /// clearOptionalData - Clear any optional optimization data from this Value. + /// Transformation passes must call this method whenever changing the IR + /// in a way that would affect the values produced by this Value, unless + /// it takes special care to ensure correctness in some other way. + void clearOptionalData() { SubclassOptionalData = 0; } + //---------------------------------------------------------------------- // Methods for handling the chain of uses of this Value. // @@ -203,13 +215,15 @@ public: ConstantStructVal, // This is an instance of ConstantStruct ConstantVectorVal, // This is an instance of ConstantVector ConstantPointerNullVal, // This is an instance of ConstantPointerNull + MDStringVal, // This is an instance of MDString + MDNodeVal, // This is an instance of MDNode InlineAsmVal, // This is an instance of InlineAsm PseudoSourceValueVal, // This is an instance of PseudoSourceValue InstructionVal, // This is an instance of Instruction // Markers: ConstantFirstVal = FunctionVal, - ConstantLastVal = ConstantPointerNullVal + ConstantLastVal = MDNodeVal }; /// getValueID - Return an ID for the concrete type of this object. This is