summaryrefslogtreecommitdiffstats
path: root/llvm/lib/AsmParser
diff options
context:
space:
mode:
authorDale Johannesen <dalej@apple.com>2008-10-09 23:00:39 +0000
committerDale Johannesen <dalej@apple.com>2008-10-09 23:00:39 +0000
commit4f0bd68cfe4f72902215e1c27411286a8bb7d641 (patch)
treec8880de304064760a3dea7762950f59e7c034cb7 /llvm/lib/AsmParser
parent54306fe499499e57ac1bf8c9cd4fbe8321015ffd (diff)
downloadbcm5719-llvm-4f0bd68cfe4f72902215e1c27411286a8bb7d641.tar.gz
bcm5719-llvm-4f0bd68cfe4f72902215e1c27411286a8bb7d641.zip
Add a "loses information" return value to APFloat::convert
and APFloat::convertToInteger. Restore return value to IEEE754. Adjust all users accordingly. llvm-svn: 57329
Diffstat (limited to 'llvm/lib/AsmParser')
-rw-r--r--llvm/lib/AsmParser/llvmAsmParser.y14
1 files changed, 10 insertions, 4 deletions
diff --git a/llvm/lib/AsmParser/llvmAsmParser.y b/llvm/lib/AsmParser/llvmAsmParser.y
index 9dc070230d8..a7a4bc00ef8 100644
--- a/llvm/lib/AsmParser/llvmAsmParser.y
+++ b/llvm/lib/AsmParser/llvmAsmParser.y
@@ -428,8 +428,11 @@ static Value *getExistingVal(const Type *Ty, const ValID &D) {
// Lexer has no type info, so builds all float and double FP constants
// as double. Fix this here. Long double does not need this.
if (&D.ConstPoolFP->getSemantics() == &APFloat::IEEEdouble &&
- Ty==Type::FloatTy)
- D.ConstPoolFP->convert(APFloat::IEEEsingle, APFloat::rmNearestTiesToEven);
+ Ty==Type::FloatTy) {
+ bool ignored;
+ D.ConstPoolFP->convert(APFloat::IEEEsingle, APFloat::rmNearestTiesToEven,
+ &ignored);
+ }
return ConstantFP::get(*D.ConstPoolFP);
case ValID::ConstNullVal: // Is it a null value?
@@ -1929,8 +1932,11 @@ ConstVal: Types '[' ConstVector ']' { // Nonempty unsized arr
GEN_ERROR("Floating point constant invalid for type");
// Lexer has no type info, so builds all float and double FP constants
// as double. Fix this here. Long double is done right.
- if (&$2->getSemantics()==&APFloat::IEEEdouble && $1==Type::FloatTy)
- $2->convert(APFloat::IEEEsingle, APFloat::rmNearestTiesToEven);
+ if (&$2->getSemantics()==&APFloat::IEEEdouble && $1==Type::FloatTy) {
+ bool ignored;
+ $2->convert(APFloat::IEEEsingle, APFloat::rmNearestTiesToEven,
+ &ignored);
+ }
$$ = ConstantFP::get(*$2);
delete $2;
CHECK_FOR_ERROR
OpenPOWER on IntegriCloud