summaryrefslogtreecommitdiffstats
path: root/llvm/include/Support/StringExtras.h
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/include/Support/StringExtras.h')
-rw-r--r--llvm/include/Support/StringExtras.h7
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);
OpenPOWER on IntegriCloud