[APFloat] Fix IsInteger() for DoubleAPFloat.

Previously, we would just assert instead.

Differential Revision:  https://reviews.llvm.org/D36961

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311351 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Davide Italiano
2017-08-21 16:51:54 +00:00
parent 2e732d6a1b
commit 6d97003cca
2 changed files with 19 additions and 4 deletions
+1 -4
View File
@@ -4363,10 +4363,7 @@ bool DoubleAPFloat::isLargest() const {
bool DoubleAPFloat::isInteger() const {
assert(Semantics == &semPPCDoubleDouble && "Unexpected Semantics");
APFloat Tmp(semPPCDoubleDoubleLegacy);
(void)Tmp.add(Floats[0], rmNearestTiesToEven);
(void)Tmp.add(Floats[1], rmNearestTiesToEven);
return Tmp.isInteger();
return Floats[0].isInteger() && Floats[1].isInteger();
}
void DoubleAPFloat::toString(SmallVectorImpl<char> &Str,