Use simplified ConstantFP::get method, fix a bug handling frem x, 0 with long doubles.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49976 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner
2008-04-20 00:26:06 +00:00
parent e0db56db31
commit eb9c8e1e3f
2 changed files with 19 additions and 16 deletions

View File

@@ -307,12 +307,11 @@ static const fltSemantics &SemanticsForType(Type *Ty) {
LLVMValueRef LLVMConstReal(LLVMTypeRef RealTy, double N) {
APFloat APN(N);
APN.convert(SemanticsForType(unwrap(RealTy)), APFloat::rmNearestTiesToEven);
return wrap(ConstantFP::get(unwrap(RealTy), APN));
return wrap(ConstantFP::get(APN));
}
LLVMValueRef LLVMConstRealOfString(LLVMTypeRef RealTy, const char *Text) {
return wrap(ConstantFP::get(unwrap(RealTy),
APFloat(SemanticsForType(unwrap(RealTy)), Text)));
return wrap(ConstantFP::get(APFloat(SemanticsForType(unwrap(RealTy)), Text)));
}
/*--.. Operations on composite constants ...................................--*/