summaryrefslogtreecommitdiff
path: root/include/llvm/ADT/StringExtras.h
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2005-01-04 01:56:28 +0000
committerChris Lattner <sabre@nondot.org>2005-01-04 01:56:28 +0000
commit67cb2f6eb5e515c25bf559bb3d5ef6fea05fd8b6 (patch)
treec34d417ba131fb6feb932e3131d4a293abc1fb82 /include/llvm/ADT/StringExtras.h
parenta5698772d4f194a3dd7720e220e4255e2d0d8c98 (diff)
downloadllvm-67cb2f6eb5e515c25bf559bb3d5ef6fea05fd8b6.tar.gz
llvm-67cb2f6eb5e515c25bf559bb3d5ef6fea05fd8b6.tar.bz2
llvm-67cb2f6eb5e515c25bf559bb3d5ef6fea05fd8b6.tar.xz
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19279 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/ADT/StringExtras.h')
-rw-r--r--include/llvm/ADT/StringExtras.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/include/llvm/ADT/StringExtras.h b/include/llvm/ADT/StringExtras.h
index 7e25f654d8..e6d1feac1a 100644
--- a/include/llvm/ADT/StringExtras.h
+++ b/include/llvm/ADT/StringExtras.h
@@ -100,7 +100,9 @@ static inline std::string itostr(int X) {
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) {