diff options
author | Andrew Lenharth <andrewl@lenharth.org> | 2006-05-31 19:16:26 +0000 |
---|---|---|
committer | Andrew Lenharth <andrewl@lenharth.org> | 2006-05-31 19:16:26 +0000 |
commit | f48ec61fbd9c823c103ff8a5d035dd89c7cecb8a (patch) | |
tree | 69997e8d7d43a8506f15ff42419e564ef7905ebb | |
parent | 190717d3cf5882e43d2797108b72df7448f47fcc (diff) |
revert for now
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28595 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | include/llvm/ADT/StringExtras.h | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/include/llvm/ADT/StringExtras.h b/include/llvm/ADT/StringExtras.h index e66fc69345..375b655b4d 100644 --- a/include/llvm/ADT/StringExtras.h +++ b/include/llvm/ADT/StringExtras.h @@ -55,7 +55,11 @@ static inline std::string utostr(uint64_t X, bool isNeg = false) { return std::string(BufPtr); } -static inline std::string utostr(uint32_t X, bool isNeg = false) { +static inline std::string utostr(unsigned long X, bool isNeg = false) { + return utostr(static_cast<uint64_t>(X), isNeg); +} + +static inline std::string utostr(unsigned X, bool isNeg = false) { char Buffer[20]; char *BufPtr = Buffer+19; @@ -79,7 +83,14 @@ static inline std::string itostr(int64_t X) { return utostr(static_cast<uint64_t>(X)); } -static inline std::string itostr(int32_t X) { +static inline std::string itostr(long X) { + if (X < 0) + return utostr(static_cast<uint64_t>(-X), true); + else + return utostr(static_cast<uint64_t>(X)); +} + +static inline std::string itostr(int X) { if (X < 0) return utostr(static_cast<unsigned>(-X), true); else |