[llvm-commits] CVS: llvm/include/llvm/ADT/StringExtras.h

Chris Lattner lattner at cs.uiuc.edu
Mon Jan 3 17:56:43 PST 2005



Changes in directory llvm/include/llvm/ADT:

StringExtras.h updated: 1.23 -> 1.24
---
Log message:

Do not let 'ftostr' return a string that starts with spaces.  This allows
the AsmWriter to emit FP constants like 1.0 in normal exponential notation
instead of hex notation.


---
Diffs of the changes:  (+3 -1)

Index: llvm/include/llvm/ADT/StringExtras.h
diff -u llvm/include/llvm/ADT/StringExtras.h:1.23 llvm/include/llvm/ADT/StringExtras.h:1.24
--- llvm/include/llvm/ADT/StringExtras.h:1.23	Wed Sep  1 17:55:34 2004
+++ llvm/include/llvm/ADT/StringExtras.h	Mon Jan  3 19:56:28 2005
@@ -100,7 +100,9 @@
 static inline std::string ftostr(double V) {
   char Buffer[200];
   sprintf(Buffer, "%20.6e", V);
-  return Buffer;
+  char *B = Buffer;
+  while (*B == ' ') ++B;
+  return B;
 }
 
 static inline std::string LowercaseString(const std::string &S) { 






More information about the llvm-commits mailing list