X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=include%2Fllvm%2FConstants.h;h=2bec1d42ab63b47c59e640758edb74f780288959;hb=a727d5502c8e23c090da658bf14c5ebc1169a070;hp=e09fc84c929a15ef8b4629ffeb5ea8d141ec5aaa;hpb=e51f2a59d93336b2be46b9663af317b96a7e045b;p=oota-llvm.git diff --git a/include/llvm/Constants.h b/include/llvm/Constants.h index e09fc84c929..2bec1d42ab6 100644 --- a/include/llvm/Constants.h +++ b/include/llvm/Constants.h @@ -189,9 +189,8 @@ public: /// @returns the 64-bit value of this constant if its active bits number is /// not greater than 64, otherwise, just return the given uint64_t number. /// @brief Get the constant's value if possible. - uint64_t getLimitedValue(uint64_t Limit) { - return (Val.getActiveBits() > 64 || Val.getZExtValue() > Limit) ? - Limit : Val.getZExtValue(); + uint64_t getLimitedValue(uint64_t Limit = ~0ULL) const { + return Val.getLimitedValue(Limit); } /// @returns the value for an integer constant of the given type that has all @@ -202,7 +201,7 @@ public: /// @brief Methods to support type inquiry through isa, cast, and dyn_cast. static inline bool classof(const ConstantInt *) { return true; } static bool classof(const Value *V) { - return V->getValueType() == ConstantIntVal; + return V->getValueID() == ConstantIntVal; } static void ResetTrueFalse() { TheTrueVal = TheFalseVal = 0; } private: @@ -240,7 +239,7 @@ public: /// Methods for support type inquiry through isa, cast, and dyn_cast: static inline bool classof(const ConstantFP *) { return true; } static bool classof(const Value *V) { - return V->getValueType() == ConstantFPVal; + return V->getValueID() == ConstantFPVal; } }; @@ -268,7 +267,7 @@ public: /// static bool classof(const ConstantAggregateZero *) { return true; } static bool classof(const Value *V) { - return V->getValueType() == ConstantAggregateZeroVal; + return V->getValueID() == ConstantAggregateZeroVal; } }; @@ -332,7 +331,7 @@ public: /// Methods for support type inquiry through isa, cast, and dyn_cast: static inline bool classof(const ConstantArray *) { return true; } static bool classof(const Value *V) { - return V->getValueType() == ConstantArrayVal; + return V->getValueID() == ConstantArrayVal; } }; @@ -377,7 +376,7 @@ public: /// Methods for support type inquiry through isa, cast, and dyn_cast: static inline bool classof(const ConstantStruct *) { return true; } static bool classof(const Value *V) { - return V->getValueType() == ConstantStructVal; + return V->getValueID() == ConstantStructVal; } }; @@ -429,7 +428,7 @@ public: /// Methods for support type inquiry through isa, cast, and dyn_cast: static inline bool classof(const ConstantVector *) { return true; } static bool classof(const Value *V) { - return V->getValueType() == ConstantVectorVal; + return V->getValueID() == ConstantVectorVal; } }; @@ -465,7 +464,7 @@ public: /// Methods for support type inquiry through isa, cast, and dyn_cast: static inline bool classof(const ConstantPointerNull *) { return true; } static bool classof(const Value *V) { - return V->getValueType() == ConstantPointerNullVal; + return V->getValueID() == ConstantPointerNullVal; } }; @@ -674,7 +673,7 @@ public: /// Methods for support type inquiry through isa, cast, and dyn_cast: static inline bool classof(const ConstantExpr *) { return true; } static inline bool classof(const Value *V) { - return V->getValueType() == ConstantExprVal; + return V->getValueID() == ConstantExprVal; } }; @@ -705,7 +704,7 @@ public: /// Methods for support type inquiry through isa, cast, and dyn_cast: static inline bool classof(const UndefValue *) { return true; } static bool classof(const Value *V) { - return V->getValueType() == UndefValueVal; + return V->getValueID() == UndefValueVal; } };