lib/CWriter/Writer.cpp: Copy AsmWriter's ConstantFP checking code here
into a new function FPCSafeToPrint(), and use it in printConstant()
and printFunction() to decide whether we should output ConstantFPs as
floating-point constants or as references to stack-allocated variables.

lib/VMCore/AsmWriter.cpp: Fix an apparent typo in the code mentioned above.

llvm-svn: 6762
diff --git a/llvm/lib/VMCore/AsmWriter.cpp b/llvm/lib/VMCore/AsmWriter.cpp
index 7695fcb..afc4b6d 100644
--- a/llvm/lib/VMCore/AsmWriter.cpp
+++ b/llvm/lib/VMCore/AsmWriter.cpp
@@ -234,7 +234,7 @@
     //
     if ((StrVal[0] >= '0' && StrVal[0] <= '9') ||
         ((StrVal[0] == '-' || StrVal[0] == '+') &&
-         (StrVal[0] >= '0' && StrVal[0] <= '9')))
+         (StrVal[1] >= '0' && StrVal[1] <= '9')))
       // Reparse stringized version!
       if (atof(StrVal.c_str()) == CFP->getValue()) {
         Out << StrVal; return;