30 if (ArgType->isIntegerTy(1)) {
31 return ConstantInt::get(ArgType, RC.
Value.BoolVal);
32 }
else if (ArgType->isIntegerTy(8)) {
33 return ConstantInt::get(ArgType, RC.
Value.Int8Val);
34 }
else if (ArgType->isIntegerTy(32)) {
35 return ConstantInt::get(ArgType, RC.
Value.Int32Val);
36 }
else if (ArgType->isIntegerTy(64)) {
37 return ConstantInt::get(ArgType, RC.
Value.Int64Val);
38 }
else if (ArgType->isFloatTy()) {
39 return ConstantFP::get(ArgType, RC.
Value.FloatVal);
40 }
else if (ArgType->isDoubleTy()) {
41 return ConstantFP::get(ArgType, RC.
Value.DoubleVal);
42 }
else if (ArgType->isX86_FP80Ty() || ArgType->isPPC_FP128Ty() ||
43 ArgType->isFP128Ty()) {
44 return ConstantFP::get(ArgType, RC.
Value.LongDoubleVal);
45 }
else if (ArgType->isPointerTy()) {
46 auto *IntC = ConstantInt::get(Type::getInt64Ty(Ctx), RC.
Value.Int64Val);
47 return ConstantExpr::getIntToPtr(IntC, ArgType);
49 std::string TypeString;
50 raw_string_ostream TypeOstream(TypeString);
51 ArgType->print(TypeOstream);
Constant * getConstant(LLVMContext &Ctx, Type *ArgType, const RuntimeConstant &RC)
Definition TransformLambdaSpecialization.hpp:28