X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=include%2Fllvm%2FConstants.h;h=a75aaf72a309c4889cf93cb071ac026ccf3def54;hb=7293ac12811c8a43023830380e70c0fda941f8ec;hp=ba0ace3f7a1bd1b163dc09b50bc489d1733fac8b;hpb=dbc56bbf755ea553e33a79ac51e0ed5dda6eb59a;p=oota-llvm.git diff --git a/include/llvm/Constants.h b/include/llvm/Constants.h index ba0ace3f7a1..a75aaf72a30 100644 --- a/include/llvm/Constants.h +++ b/include/llvm/Constants.h @@ -25,7 +25,6 @@ #include "llvm/OperandTraits.h" #include "llvm/ADT/APInt.h" #include "llvm/ADT/APFloat.h" -#include "llvm/ADT/SmallVector.h" #include namespace llvm { @@ -33,7 +32,6 @@ namespace llvm { class ArrayType; class IntegerType; class StructType; -class UnionType; class PointerType; class VectorType; @@ -41,6 +39,8 @@ template struct ConstantCreator; template struct ConvertConstantType; +template +class SmallVector; //===----------------------------------------------------------------------===// /// This is the shared class of boolean and integer constants. This class @@ -459,49 +459,6 @@ struct OperandTraits : public VariadicOperandTraits<> { DEFINE_TRANSPARENT_CASTED_OPERAND_ACCESSORS(ConstantStruct, Constant) -//===----------------------------------------------------------------------===// -// ConstantUnion - Constant Union Declarations -// -class ConstantUnion : public Constant { - friend struct ConstantCreator; - ConstantUnion(const ConstantUnion &); // DO NOT IMPLEMENT -protected: - ConstantUnion(const UnionType *T, Constant* Val); -public: - // ConstantUnion accessors - static Constant *get(const UnionType *T, Constant* V); - - /// Transparently provide more efficient getOperand methods. - DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Constant); - - /// getType() specialization - Reduce amount of casting... - /// - inline const UnionType *getType() const { - return reinterpret_cast(Value::getType()); - } - - /// isNullValue - Return true if this is the value that would be returned by - /// getNullValue. This always returns false because zero structs are always - /// created as ConstantAggregateZero objects. - virtual bool isNullValue() const { - return false; - } - - virtual void destroyConstant(); - virtual void replaceUsesOfWithOnConstant(Value *From, Value *To, Use *U); - - /// Methods for support type inquiry through isa, cast, and dyn_cast: - static inline bool classof(const ConstantUnion *) { return true; } - static bool classof(const Value *V) { - return V->getValueID() == ConstantUnionVal; - } -}; - -template <> -struct OperandTraits : public FixedNumOperandTraits<1> { -}; - -DEFINE_TRANSPARENT_CASTED_OPERAND_ACCESSORS(ConstantUnion, Constant) //===----------------------------------------------------------------------===// /// ConstantVector - Constant Vector Declarations @@ -923,7 +880,11 @@ DEFINE_TRANSPARENT_CASTED_OPERAND_ACCESSORS(ConstantExpr, Constant) /// UndefValue - 'undef' values are things that do not have specified contents. /// These are used for a variety of purposes, including global variable /// initializers and operands to instructions. 'undef' values can occur with -/// any type. +/// any first-class type. +/// +/// Undef values aren't exactly constants; if they have multiple uses, they +/// can appear to have different bit patterns at each use. See +/// LangRef.html#undefvalues for details. /// class UndefValue : public Constant { friend struct ConstantCreator; @@ -954,6 +915,7 @@ public: return V->getValueID() == UndefValueVal; } }; + } // End llvm namespace #endif