14using namespace fuzzerop;
17 cl::desc(
"Use undef when generating programs."),
21 if (
auto *IntTy = dyn_cast<IntegerType>(
T)) {
23 Cs.push_back(ConstantInt::get(IntTy, 0));
24 Cs.push_back(ConstantInt::get(IntTy, 1));
25 Cs.push_back(ConstantInt::get(IntTy, 42));
31 }
else if (
T->isFloatingPointTy()) {
32 auto &Ctx =
T->getContext();
33 auto &Sem =
T->getFltSemantics();
35 Cs.push_back(ConstantFP::get(Ctx,
APFloat(Sem, 1)));
36 Cs.push_back(ConstantFP::get(Ctx,
APFloat(Sem, 42)));
41 }
else if (
VectorType *VecTy = dyn_cast<VectorType>(
T)) {
42 std::vector<Constant *> EleCs;
43 Type *EltTy = VecTy->getElementType();
57 std::vector<Constant *> Result;
This file contains the declarations for the subclasses of Constant, which represent the different fla...
static cl::opt< bool > UseUndef("use-undef", cl::desc("Use undef when generating programs."), cl::init(false))
static APFloat getLargest(const fltSemantics &Sem, bool Negative=false)
Returns the largest finite number in the given semantics.
static APFloat getInf(const fltSemantics &Sem, bool Negative=false)
Factory for Positive and Negative Infinity.
static APFloat getSmallest(const fltSemantics &Sem, bool Negative=false)
Returns the smallest (by magnitude) finite number in the given semantics.
static APFloat getNaN(const fltSemantics &Sem, bool Negative=false, uint64_t payload=0)
Factory for NaN values.
static APFloat getZero(const fltSemantics &Sem, bool Negative=false)
Factory for Positive and Negative Zero.
static APInt getMaxValue(unsigned numBits)
Gets maximum unsigned value of APInt for specific bit width.
static APInt getSignedMaxValue(unsigned numBits)
Gets maximum signed value of APInt for a specific bit width.
static APInt getMinValue(unsigned numBits)
Gets minimum unsigned value of APInt for a specific bit width.
static APInt getSignedMinValue(unsigned numBits)
Gets minimum signed value of APInt for a specific bit width.
static APInt getOneBitSet(unsigned numBits, unsigned BitNo)
Return an APInt with exactly one bit set in the result.
static Constant * getSplat(ElementCount EC, Constant *Elt)
Return a ConstantVector with the specified constant in each element.
This is an important base class in LLVM.
static PoisonValue * get(Type *T)
Static factory methods - Return an 'poison' object of the specified type.
The instances of the Type class are immutable: once they are created, they are never changed.
static UndefValue * get(Type *T)
Static factory methods - Return an 'undef' object of the specified type.
Base class of all SIMD vector types.
initializer< Ty > init(const Ty &Val)
void makeConstantsWithType(Type *T, std::vector< Constant * > &Cs)
This is an optimization pass for GlobalISel generic memory operations.