Remove SmallString::append_*int* methods; how many copies of int -> str
authorDaniel Dunbar <daniel@zuster.org>
Wed, 19 Aug 2009 19:28:18 +0000 (19:28 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Wed, 19 Aug 2009 19:28:18 +0000 (19:28 +0000)
conversion code do we really need?
 - S.append_uint(N) can be replaced with 'raw_svector_ostream(S) << N' which is
   somewhat slower due to the extra set up cost, but still plenty fast
   (especially if the svector set up cost can be amortized).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79450 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/ADT/SmallString.h

index bbc3c0526ad4e7d76815def0f70c09e218533eb8..7d3bff6685abd5f192a7ce5e39f5135004fffaa7 100644 (file)
@@ -59,47 +59,6 @@ public:
     this->push_back(C);
     return *this;
   }
-
-  SmallString &append_uint_32(uint32_t N) {
-    char Buffer[20];
-    char *BufPtr = Buffer+20;
-
-    if (N == 0) *--BufPtr = '0';  // Handle special case.
-
-    while (N) {
-      *--BufPtr = '0' + char(N % 10);
-      N /= 10;
-    }
-    this->append(BufPtr, Buffer+20);
-    return *this;
-  }
-
-  SmallString &append_uint(uint64_t N) {
-    if (N == uint32_t(N))
-      return append_uint_32(uint32_t(N));
-
-    char Buffer[40];
-    char *BufPtr = Buffer+40;
-
-    if (N == 0) *--BufPtr = '0';  // Handle special case...
-
-    while (N) {
-      *--BufPtr = '0' + char(N % 10);
-      N /= 10;
-    }
-
-    this->append(BufPtr, Buffer+40);
-    return *this;
-  }
-
-  SmallString &append_sint(int64_t N) {
-    if (N < 0) {
-      this->push_back('-');
-      N = -N;
-    }
-    return append_uint((uint64_t)N);
-  }
-
 };