diff options
author | Misha Brukman <brukman+llvm@gmail.com> | 2004-08-17 18:08:52 +0000 |
---|---|---|
committer | Misha Brukman <brukman+llvm@gmail.com> | 2004-08-17 18:08:52 +0000 |
commit | a9ed31a50b43548c6e249bb0e97bcfc3a339f4d3 (patch) | |
tree | 0844f6ccf28fbba6ec2b7b02031716640c957e8e /llvm/include/Support/StringExtras.h | |
parent | 0f2e2f7e5b8f872c8a0cd132cd4611be8b9796d8 (diff) | |
download | bcm5719-llvm-a9ed31a50b43548c6e249bb0e97bcfc3a339f4d3.tar.gz bcm5719-llvm-a9ed31a50b43548c6e249bb0e97bcfc3a339f4d3.zip |
Add itostr(long) for our furry 64-bit friends.
llvm-svn: 15885
Diffstat (limited to 'llvm/include/Support/StringExtras.h')
-rw-r--r-- | llvm/include/Support/StringExtras.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/include/Support/StringExtras.h b/llvm/include/Support/StringExtras.h index fdf32272de8..628528d322d 100644 --- a/llvm/include/Support/StringExtras.h +++ b/llvm/include/Support/StringExtras.h @@ -84,6 +84,13 @@ static inline std::string utostr(unsigned X, bool isNeg = false) { return std::string(BufPtr); } +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); |