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 | 7a9bb9eeecae6752fb64c090c0d58c817e9cf499 (patch) | |
tree | d0f27eb8fbdf95a4bf0ba368727be59672c3e6b3 /llvm/lib/Support/raw_ostream.cpp | |
parent | d36792c86f47346004e3a14227dd9db4ea56f345 (diff) | |
download | bcm5719-llvm-7a9bb9eeecae6752fb64c090c0d58c817e9cf499.tar.gz bcm5719-llvm-7a9bb9eeecae6752fb64c090c0d58c817e9cf499.zip |
Add slow path for single character write, and use exclusively for
single characters writes outside of the fast path in raw_ostream.h
llvm-svn: 67053
Diffstat (limited to 'llvm/lib/Support/raw_ostream.cpp')
-rw-r--r-- | llvm/lib/Support/raw_ostream.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/llvm/lib/Support/raw_ostream.cpp b/llvm/lib/Support/raw_ostream.cpp index 5a99a0cf403..43f46837d37 100644 --- a/llvm/lib/Support/raw_ostream.cpp +++ b/llvm/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) |