diff options
author | Daniel Dunbar <daniel@zuster.org> | 2009-03-16 22:00:17 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2009-03-16 22:00:17 +0000 |
commit | de75d7ffcd5ed315240cfe0c52a821cf66411eda (patch) | |
tree | 3dfcc279db6a92120231c5c9ef7fec815bcb584d /lib | |
parent | af3f5441b51c5f5317a585c816201e16b46891c6 (diff) | |
download | external_llvm-de75d7ffcd5ed315240cfe0c52a821cf66411eda.zip external_llvm-de75d7ffcd5ed315240cfe0c52a821cf66411eda.tar.gz external_llvm-de75d7ffcd5ed315240cfe0c52a821cf66411eda.tar.bz2 |
Add slow path for single character write, and use exclusively for
single characters writes outside of the fast path in raw_ostream.h
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67053 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Support/raw_ostream.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/Support/raw_ostream.cpp b/lib/Support/raw_ostream.cpp index 5a99a0c..43f4683 100644 --- a/lib/Support/raw_ostream.cpp +++ b/lib/Support/raw_ostream.cpp @@ -63,10 +63,7 @@ raw_ostream &raw_ostream::operator<<(unsigned long N) { raw_ostream &raw_ostream::operator<<(long N) { if (N < 0) { - if (OutBufCur >= OutBufEnd) - flush_impl(); - *OutBufCur++ = '-'; - + *this << '-'; N = -N; } @@ -91,10 +88,7 @@ raw_ostream &raw_ostream::operator<<(unsigned long long N) { raw_ostream &raw_ostream::operator<<(long long N) { if (N < 0) { - if (OutBufCur >= OutBufEnd) - flush_impl(); - *OutBufCur++ = '-'; - + *this << '-'; N = -N; } @@ -106,6 +100,12 @@ raw_ostream &raw_ostream::operator<<(const void *P) { return *this << format("%p", P); } +raw_ostream &raw_ostream::write(unsigned char C) { + if (OutBufCur >= OutBufEnd) + flush_impl(); + + *OutBufCur++ = C; +} raw_ostream &raw_ostream::write(const char *Ptr, unsigned Size) { if (OutBufCur+Size > OutBufEnd) |