LLVM API Documentation
#include <Constants.h>
Inheritance diagram for llvm::ConstantIntegral:
Public Member Functions | |
uint64_t | getRawValue () const |
uint64_t | getZExtValue () const |
int64_t | getSExtValue () const |
virtual bool | isNullValue () const=0 |
virtual bool | isMaxValue () const=0 |
virtual bool | isMinValue () const=0 |
virtual bool | isAllOnesValue () const=0 |
Static Public Member Functions | |
static ConstantIntegral * | getMaxValue (const Type *Ty) |
static ConstantIntegral * | getMinValue (const Type *Ty) |
static ConstantIntegral * | getAllOnesValue (const Type *Ty) |
static bool | classof (const ConstantIntegral *) |
Methods for support type inquiry through isa, cast, and dyn_cast:. | |
static bool | classof (const Value *V) |
Protected Member Functions | |
ConstantIntegral (const Type *Ty, ValueTy VT, uint64_t V) | |
Protected Attributes | |
union { | |
int64_t Signed | |
uint64_t Unsigned | |
} | Val |
This class just defines some common interfaces to be implemented.
Definition at line 43 of file Constants.h.
uint64_t llvm::ConstantIntegral::getRawValue | ( | ) | const [inline] |
getRawValue - return the underlying value of this constant as a 64-bit unsigned integer value.
Definition at line 55 of file Constants.h.
References Val.
Referenced by CollectBSwapParts(), EvaluateStoreInto(), getAggregateConstantElement(), llvm::ConstantBool::getValue(), isHighOnes(), isOneBitSet(), isSignBit(), and OptimizeGlobalAddressOfMalloc().
uint64_t llvm::ConstantIntegral::getZExtValue | ( | ) | const [inline] |
getZExtValue - Return the constant zero extended as appropriate for this type.
Definition at line 59 of file Constants.h.
References llvm::Type::getPrimitiveSizeInBits(), llvm::Value::getType(), and Val.
Referenced by ShrinkDemandedConstant().
int64_t llvm::ConstantIntegral::getSExtValue | ( | ) | const [inline] |
getSExtValue - Return the constant sign extended as appropriate for this type.
Definition at line 66 of file Constants.h.
References llvm::Type::getPrimitiveSizeInBits(), llvm::Value::getType(), and Val.
virtual bool llvm::ConstantIntegral::isNullValue | ( | ) | const [pure virtual] |
isNullValue - Return true if this is the value that would be returned by getNullValue.
Implements llvm::Constant.
Implemented in llvm::ConstantBool, and llvm::ConstantInt.
virtual bool llvm::ConstantIntegral::isMaxValue | ( | ) | const [pure virtual] |
isMaxValue - Return true if this is the largest value that may be represented by this type.
Implemented in llvm::ConstantBool, llvm::ConstantInt, llvm::ConstantSInt, and llvm::ConstantUInt.
virtual bool llvm::ConstantIntegral::isMinValue | ( | ) | const [pure virtual] |
isMinValue - Return true if this is the smallest value that may be represented by this type.
Implemented in llvm::ConstantBool, llvm::ConstantInt, llvm::ConstantSInt, and llvm::ConstantUInt.
virtual bool llvm::ConstantIntegral::isAllOnesValue | ( | ) | const [pure virtual] |
isAllOnesValue - Return true if every bit in this constant is set to true.
Implemented in llvm::ConstantBool, llvm::ConstantSInt, and llvm::ConstantUInt.
Referenced by isSignBitCheck().
ConstantIntegral * ConstantIntegral::getMaxValue | ( | const Type * | Ty | ) | [static] |
Static constructor to get the maximum/minimum/allones constant of specified (integral) type...
Definition at line 128 of file Constants.cpp.
References llvm::Type::BoolTyID, llvm::ConstantSInt::get(), getAllOnesValue(), llvm::Type::getPrimitiveSize(), llvm::Type::getTypeID(), INT64_MAX, llvm::Type::IntTyID, llvm::Type::LongTyID, llvm::Type::SByteTyID, llvm::Type::ShortTyID, llvm::ConstantBool::True, llvm::Type::UByteTyID, llvm::Type::UIntTyID, llvm::Type::ULongTyID, llvm::Type::UShortTyID, and Val.
Referenced by llvm::ConstantRange::ConstantRange(), and llvm::ConstantRange::isFullSet().
ConstantIntegral * ConstantIntegral::getMinValue | ( | const Type * | Ty | ) | [static] |
Definition at line 152 of file Constants.cpp.
References llvm::Type::BoolTyID, llvm::ConstantBool::False, llvm::ConstantUInt::get(), llvm::ConstantSInt::get(), llvm::Type::getPrimitiveSize(), llvm::Type::getTypeID(), llvm::Type::IntTyID, llvm::Type::LongTyID, llvm::Type::SByteTyID, llvm::Type::ShortTyID, llvm::Type::UByteTyID, llvm::Type::UIntTyID, llvm::Type::ULongTyID, llvm::Type::UShortTyID, and Val.
Referenced by llvm::ConstantRange::ConstantRange(), and llvm::ConstantRange::isEmptySet().
ConstantIntegral * ConstantIntegral::getAllOnesValue | ( | const Type * | Ty | ) | [static] |
Definition at line 176 of file Constants.cpp.
References llvm::Type::BoolTyID, llvm::ConstantUInt::get(), llvm::ConstantSInt::get(), llvm::Type::getTypeID(), llvm::Type::IntTyID, llvm::Type::LongTyID, llvm::Type::SByteTyID, llvm::Type::ShortTyID, llvm::ConstantBool::True, llvm::Type::UByteTyID, llvm::Type::UIntTyID, llvm::Type::ULongTyID, llvm::Type::UShortTyID, and Val.
Referenced by llvm::ConstantFoldBinaryInstruction(), llvm::BinaryOperator::createNot(), getMaxValue(), llvm::ConstantExpr::getNot(), and llvm::ConstantExpr::getSignExtend().
static bool llvm::ConstantIntegral::classof | ( | const ConstantIntegral * | ) | [inline, static] |
Methods for support type inquiry through isa, cast, and dyn_cast:.
Definition at line 98 of file Constants.h.
static bool llvm::ConstantIntegral::classof | ( | const Value * | V | ) | [inline, static] |
Reimplemented from llvm::Constant.
Reimplemented in llvm::ConstantBool, llvm::ConstantInt, llvm::ConstantSInt, and llvm::ConstantUInt.
Definition at line 99 of file Constants.h.
References llvm::Value::ConstantBoolVal, llvm::Value::ConstantSIntVal, llvm::Value::ConstantUIntVal, and V.
int64_t llvm::ConstantIntegral::Signed [protected] |
Definition at line 46 of file Constants.h.
uint64_t llvm::ConstantIntegral::Unsigned [protected] |
Definition at line 47 of file Constants.h.
union { ... } llvm::ConstantIntegral::Val [protected] |
Referenced by ConstantIntegral(), llvm::ConstantInt::equalsInt(), getAllOnesValue(), getMaxValue(), getMinValue(), getRawValue(), getSExtValue(), llvm::ConstantUInt::getValue(), llvm::ConstantSInt::getValue(), getZExtValue(), llvm::ConstantUInt::isAllOnesValue(), and llvm::ConstantInt::isNullValue().