Be a bit more efficient when processing the active and inactive
[oota-llvm.git] / include / Support / StringExtras.h
index 51df4f19f6c48156280178ec3fe51ae21bad32bb..fcfa65f232f48dfaa9d5775212b3e1981ae35d42 100644 (file)
@@ -15,9 +15,9 @@
 #define SUPPORT_STRINGEXTRAS_H
 
 #include "Support/DataTypes.h"
+#include <cctype>
+#include <cstdio>
 #include <string>
-#include <ctype.h>
-#include <stdio.h>
 
 namespace llvm {
 
@@ -55,14 +55,6 @@ static inline std::string utostr(unsigned long long X, bool isNeg = false) {
   return std::string(BufPtr);
 }
 
-static inline std::string itostr(int64_t X) {
-  if (X < 0) 
-    return utostr(static_cast<uint64_t>(-X), true);
-  else
-    return utostr(static_cast<uint64_t>(X));
-}
-
-
 static inline std::string utostr(unsigned long X, bool isNeg = false) {
   return utostr(static_cast<unsigned long long>(X), isNeg);
 }
@@ -84,6 +76,20 @@ static inline std::string utostr(unsigned X, bool isNeg = false) {
   return std::string(BufPtr);
 }
 
+static inline std::string itostr(long 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(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);