-static const fltSemantics &SemanticsForType(Type *Ty) {
- assert(Ty->isFloatingPoint() && "Type is not floating point!");
- if (Ty == Type::getFloatTy(Ty->getContext()))
- return APFloat::IEEEsingle;
- if (Ty == Type::getDoubleTy(Ty->getContext()))
- return APFloat::IEEEdouble;
- if (Ty == Type::getX86_FP80Ty(Ty->getContext()))
- return APFloat::x87DoubleExtended;
- if (Ty == Type::getFP128Ty(Ty->getContext()))
- return APFloat::IEEEquad;
- if (Ty == Type::getPPC_FP128Ty(Ty->getContext()))
- return APFloat::PPCDoubleDouble;
- return APFloat::Bogus;
+LLVMValueRef LLVMConstIntOfString(LLVMTypeRef IntTy, const char Str[],
+ uint8_t Radix) {
+ return wrap(ConstantInt::get(unwrap<IntegerType>(IntTy), StringRef(Str),
+ Radix));
+}
+
+LLVMValueRef LLVMConstIntOfStringAndSize(LLVMTypeRef IntTy, const char Str[],
+ unsigned SLen, uint8_t Radix) {
+ return wrap(ConstantInt::get(unwrap<IntegerType>(IntTy), StringRef(Str, SLen),
+ Radix));