diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2012-03-23 11:26:29 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2012-03-23 11:26:29 +0000 |
commit | e68e77569ff424d7c28f7386434103ecf2ebb9cb (patch) | |
tree | 6f26226007f2aa48bfd5f90897d969957656f492 /include/llvm/ADT/StringExtras.h | |
parent | d25dc3358bc81d380eb09f59b4d29dd6c53215ac (diff) | |
download | llvm-e68e77569ff424d7c28f7386434103ecf2ebb9cb.tar.gz llvm-e68e77569ff424d7c28f7386434103ecf2ebb9cb.tar.bz2 llvm-e68e77569ff424d7c28f7386434103ecf2ebb9cb.tar.xz |
Move ftostr into its last user (cppbackend) and simplify it a bit.
New code should use raw_ostream.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153326 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/ADT/StringExtras.h')
-rw-r--r-- | include/llvm/ADT/StringExtras.h | 21 |
1 files changed, 0 insertions, 21 deletions
diff --git a/include/llvm/ADT/StringExtras.h b/include/llvm/ADT/StringExtras.h index 4e0e018b6b..655d884e7b 100644 --- a/include/llvm/ADT/StringExtras.h +++ b/include/llvm/ADT/StringExtras.h @@ -15,12 +15,7 @@ #define LLVM_ADT_STRINGEXTRAS_H #include "llvm/Support/DataTypes.h" -#include "llvm/ADT/APFloat.h" -#include "llvm/ADT/DenseMapInfo.h" #include "llvm/ADT/StringRef.h" -#include <cctype> -#include <cstdio> -#include <string> namespace llvm { template<typename T> class SmallVectorImpl; @@ -101,22 +96,6 @@ static inline std::string itostr(int64_t X) { return utostr(static_cast<uint64_t>(X)); } -static inline std::string ftostr(double V) { - char Buffer[200]; - sprintf(Buffer, "%20.6e", V); - char *B = Buffer; - while (*B == ' ') ++B; - return B; -} - -static inline std::string ftostr(const APFloat& V) { - if (&V.getSemantics() == &APFloat::IEEEdouble) - return ftostr(V.convertToDouble()); - else if (&V.getSemantics() == &APFloat::IEEEsingle) - return ftostr((double)V.convertToFloat()); - return "<unknown format in ftostr>"; // error -} - /// StrInStrNoCase - Portable version of strcasestr. Locates the first /// occurrence of string 's1' in string 's2', ignoring case. Returns /// the offset of s2 in s1 or npos if s2 cannot be found. |