X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=include%2Fllvm%2FConstants.h;h=cce4d49d1fbaf7fea9c330d1a7fb456c9fc2395e;hb=a51139f446bc9083096885f5f8956db6c8c77981;hp=0b3784f0d6d703007b91c754fa3c01f50445ead5;hpb=225e8dd2f512e3e6840ba7cb1570fdc4d56a853f;p=oota-llvm.git diff --git a/include/llvm/Constants.h b/include/llvm/Constants.h index 0b3784f0d6d..cce4d49d1fb 100644 --- a/include/llvm/Constants.h +++ b/include/llvm/Constants.h @@ -22,7 +22,6 @@ #include "llvm/Constant.h" #include "llvm/Type.h" -#include "llvm/Support/DataTypes.h" namespace llvm { @@ -59,7 +58,7 @@ public: /// type. inline uint64_t getZExtValue() const { unsigned Size = getType()->getPrimitiveSizeInBits(); - return Val.Unsigned & (~0ULL >> (64-Size)); + return Val.Unsigned & (~uint64_t(0UL) >> (64-Size)); } /// getSExtValue - Return the constant sign extended as appropriate for this @@ -323,8 +322,6 @@ public: virtual bool isNullValue() const { return true; } virtual void destroyConstant(); - virtual void replaceUsesOfWithOnConstant(Value *From, Value *To, - bool DisableChecking = false); /// Methods for support type inquiry through isa, cast, and dyn_cast: /// @@ -348,7 +345,14 @@ protected: public: /// get() - Static factory methods - Return objects of the specified value static Constant *get(const ArrayType *T, const std::vector &); - static Constant *get(const std::string &Initializer); + + /// This method constructs a ConstantArray and initializes it with a text + /// string. The default behavior (AddNull==true) causes a null terminator to + /// be placed at the end of the array. This effectively increases the length + /// of the array by one (you've been warned). However, in some situations + /// this is not desired so if AddNull==false then the string is copied without + /// null termination. + static Constant *get(const std::string &Initializer, bool AddNull = true); /// getType - Specialize the getType() method to always return an ArrayType, /// which reduces the amount of casting needed in parts of the compiler. @@ -372,8 +376,7 @@ public: virtual bool isNullValue() const { return false; } virtual void destroyConstant(); - virtual void replaceUsesOfWithOnConstant(Value *From, Value *To, - bool DisableChecking = false); + 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 ConstantArray *) { return true; } @@ -413,8 +416,7 @@ public: } virtual void destroyConstant(); - virtual void replaceUsesOfWithOnConstant(Value *From, Value *To, - bool DisableChecking = false); + 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 ConstantStruct *) { return true; } @@ -451,8 +453,7 @@ public: virtual bool isNullValue() const { return false; } virtual void destroyConstant(); - virtual void replaceUsesOfWithOnConstant(Value *From, Value *To, - bool DisableChecking = false); + 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 ConstantPacked *) { return true; } @@ -526,6 +527,12 @@ protected: Constant *C1, Constant *C2, Constant *C3); static Constant *getGetElementPtrTy(const Type *Ty, Constant *C, const std::vector &IdxList); + static Constant *getExtractElementTy(const Type *Ty, Constant *Val, + Constant *Idx); + static Constant *getInsertElementTy(const Type *Ty, Constant *Val, + Constant *Elt, Constant *Idx); + static Constant *getShuffleVectorTy(const Type *Ty, Constant *V1, + Constant *V2, Constant *Mask); public: // Static methods to construct a ConstantExpr of different kinds. Note that @@ -593,6 +600,10 @@ public: static Constant *getGetElementPtr(Constant *C, const std::vector &IdxList); + static Constant *getExtractElement(Constant *Vec, Constant *Idx); + static Constant *getInsertElement(Constant *Vec, Constant *Elt,Constant *Idx); + static Constant *getShuffleVector(Constant *V1, Constant *V2, Constant *Mask); + /// isNullValue - Return true if this is the value that would be returned by /// getNullValue. virtual bool isNullValue() const { return false; } @@ -604,8 +615,7 @@ public: const char *getOpcodeName() const; virtual void destroyConstant(); - virtual void replaceUsesOfWithOnConstant(Value *From, Value *To, - bool DisableChecking = false); + virtual void replaceUsesOfWithOnConstant(Value *From, Value *To, Use *U); /// Override methods to provide more type information... inline Constant *getOperand(unsigned i) {