further apfloat'ize the front-end, allowing codegen to pass
APFloat straight through to LLVM now.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42236 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/CodeGen/CGExprScalar.cpp b/CodeGen/CGExprScalar.cpp
index 319ca82..155cf3b 100644
--- a/CodeGen/CGExprScalar.cpp
+++ b/CodeGen/CGExprScalar.cpp
@@ -93,13 +93,7 @@
return llvm::ConstantInt::get(E->getValue());
}
Value *VisitFloatingLiteral(const FloatingLiteral *E) {
- double V = E->getValue();
- // FIXME: Change this when FloatingLiteral uses an APFloat internally.
- const llvm::Type *Ty = ConvertType(E->getType());
- if (Ty == llvm::Type::FloatTy)
- return llvm::ConstantFP::get(Ty, llvm::APFloat((float)V));
- assert(Ty == llvm::Type::DoubleTy && "Unknown float type!");
- return llvm::ConstantFP::get(Ty, llvm::APFloat((double)V));
+ return llvm::ConstantFP::get(ConvertType(E->getType()), E->getValue());
}
Value *VisitCharacterLiteral(const CharacterLiteral *E) {
return llvm::ConstantInt::get(ConvertType(E->getType()), E->getValue());