From b5e1decefbc294008449f3b414290ab63e713ed5 Mon Sep 17 00:00:00 2001 From: Misha Brukman Date: Tue, 17 Aug 2004 18:08:52 +0000 Subject: Add itostr(long) for our furry 64-bit friends. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15885 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/Support/StringExtras.h | 7 +++++++ include/llvm/ADT/StringExtras.h | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/include/Support/StringExtras.h b/include/Support/StringExtras.h index fdf3227..628528d 100644 --- a/include/Support/StringExtras.h +++ b/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(-X), true); + else + return utostr(static_cast(X)); +} + static inline std::string itostr(int X) { if (X < 0) return utostr(static_cast(-X), true); diff --git a/include/llvm/ADT/StringExtras.h b/include/llvm/ADT/StringExtras.h index fdf3227..628528d 100644 --- a/include/llvm/ADT/StringExtras.h +++ b/include/llvm/ADT/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(-X), true); + else + return utostr(static_cast(X)); +} + static inline std::string itostr(int X) { if (X < 0) return utostr(static_cast(-X), true); -- cgit v1.1