void operator=(const Constant &); // Do not implement
Constant(const Constant &); // Do not implement
protected:
- Constant(const Type *Ty, ValueTy vty, Use *Ops, unsigned NumOps,
- const std::string& Name = "")
- : User(Ty, vty, Ops, NumOps, Name) {}
+ Constant(const Type *Ty, ValueTy vty, Use *Ops, unsigned NumOps)
+ : User(Ty, vty, Ops, NumOps) {}
void destroyConstantImpl();
public:
///
static Constant *getNullValue(const Type *Ty);
+ /// Static constructor to get a '-1' constant. This supports integers and
+ /// vectors.
+ ///
+ static Constant *getAllOnesValue(const Type *Ty);
+
/// isNullValue - Return true if this is the value that would be returned by
/// getNullValue.
virtual bool isNullValue() const = 0;
/// true for things like constant expressions that could divide by zero.
bool canTrap() const;
+ /// ContaintsRelocations - Return true if the constant value contains
+ /// relocations which cannot be resolved at compile time.
+ bool ContainsRelocations() const;
+
// Specialize get/setOperand for Constant's as their operands are always
// constants as well.
Constant *getOperand(unsigned i) {
static inline bool classof(const Constant *) { return true; }
static inline bool classof(const GlobalValue *) { return true; }
static inline bool classof(const Value *V) {
- return V->getValueType() >= ConstantFirstVal &&
- V->getValueType() <= ConstantLastVal;
+ return V->getValueID() >= ConstantFirstVal &&
+ V->getValueID() <= ConstantLastVal;
}
/// replaceUsesOfWithOnConstant - This method is a special form of