From 22bed5db2f34a5b351e133d24603d12f45e96e44 Mon Sep 17 00:00:00 2001 From: NAKAMURA Takumi Date: Thu, 16 Feb 2012 08:12:24 +0000 Subject: [PATCH] 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 --- lib/VMCore/AsmWriter.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/VMCore/AsmWriter.cpp b/lib/VMCore/AsmWriter.cpp index 21d4566a080..6874906cfdd 100644 --- a/lib/VMCore/AsmWriter.cpp +++ b/lib/VMCore/AsmWriter.cpp @@ -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;