VMCore/AsmWriter.cpp: Tweak to check #INF and #NAN earlier.

With MSVCRT, prior checker missed emission of #INF and #NAN.

FIXME: Checking should be simpler.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150667 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
NAKAMURA Takumi 2012-02-16 08:12:24 +00:00
parent 0f0c411079
commit 22bed5db2f

View File

@ -719,7 +719,9 @@ static void WriteConstantInternal(raw_ostream &Out, const Constant *CV,
bool ignored;
bool isHalf = &CFP->getValueAPF().getSemantics()==&APFloat::IEEEhalf;
bool isDouble = &CFP->getValueAPF().getSemantics()==&APFloat::IEEEdouble;
if (!isHalf) {
bool isInf = CFP->getValueAPF().isInfinity();
bool isNaN = CFP->getValueAPF().isNaN();
if (!isHalf && !isInf && !isNaN) {
double Val = isDouble ? CFP->getValueAPF().convertToDouble() :
CFP->getValueAPF().convertToFloat();
SmallString<128> StrVal;