14 #ifndef LLVM_IR_CONSTANT_H 15 #define LLVM_IR_CONSTANT_H 45 :
User(ty, vty, Ops, NumOps) {}
141 static_assert(ConstantFirstVal == 0,
"V->getValueID() >= ConstantFirstVal always succeeds");
186 #endif // LLVM_IR_CONSTANT_H bool isAllOnesValue() const
Return true if this is the value that would be returned by getAllOnesValue.
unsigned getValueID() const
Return an ID for the concrete type of this object.
bool isNaN() const
Return true if this is a floating-point NaN constant or a vector floating-point constant with all NaN...
This class represents lattice values for constants.
bool needsRelocation() const
This method classifies the entry according to whether or not it may generate a relocation entry...
bool isConstantUsed() const
Return true if the constant has users other than constant expressions and other dangling things...
static bool classof(const Value *V)
const APInt & getUniqueInteger() const
If C is a constant integer then return its value, otherwise C must be a vector of constant integers...
static Constant * getNullValue(Type *Ty)
Constructor to create a '0' constant of arbitrary type.
A Use represents the edge between a Value definition and its users.
bool isNullValue() const
Return true if this is the value that would be returned by getNullValue.
bool canTrap() const
Return true if evaluation of this constant could trap.
bool isFiniteNonZeroFP() const
Return true if this is a finite and non-zero floating-point scalar constant or a vector constant with...
Constant(Type *ty, ValueTy vty, Use *Ops, unsigned NumOps)
bool isMinSignedValue() const
Return true if the value is the smallest signed value.
void removeDeadConstantUsers() const
If there are any dead constant users dangling off of this constant, remove them.
Constant * getAggregateElement(unsigned Elt) const
For aggregates (struct/array/vector) return the constant that corresponds to the specified element if...
bool isZeroValue() const
Return true if the value is negative zero or null value.
bool isThreadDependent() const
Return true if the value can vary between threads.
Constant * stripPointerCasts()
The instances of the Type class are immutable: once they are created, they are never changed...
This is an important base class in LLVM.
bool isDLLImportDependent() const
Return true if the value is dependent on a dllimport variable.
bool isNegativeZeroValue() const
Return true if the value is what would be returned by getZeroValueForNegation.
static Constant * getAllOnesValue(Type *Ty)
const Constant * stripPointerCasts() const
const Value * stripPointerCasts() const
Strip off pointer casts, all-zero GEPs, and aliases.
Constant * getSplatValue() const
If this is a splat vector constant, meaning that all of the elements have the same value...
static Constant * getIntegerValue(Type *Ty, const APInt &V)
Return the value for an integer or pointer constant, or a vector thereof, with the given scalar value...
bool isNormalFP() const
Return true if this is a normal (as opposed to denormal) floating-point scalar constant or a vector c...
bool containsUndefElement() const
Return true if this is a vector constant that includes any undefined elements.
ValueTy
Concrete subclass of this.
void handleOperandChange(Value *, Value *)
This method is a special form of User::replaceUsesOfWith (which does not work on constants) that does...
Class for arbitrary precision integers.
void destroyConstant()
Called if some element of this constant is no longer valid.
bool isOneValue() const
Returns true if the value is one.
LLVM Value Representation.
void operator=(const Constant &)=delete
bool hasExactInverseFP() const
Return true if this scalar has an exact multiplicative inverse or this vector has an exact multiplica...
bool isNotMinSignedValue() const
Return true if the value is not the smallest signed value.