aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorDavid Greene <greened@obbligato.org>2009-07-28 23:26:34 +0000
committerDavid Greene <greened@obbligato.org>2009-07-28 23:26:34 +0000
commit7aaad71722aeb26f14c8523ee55df91e38837a02 (patch)
treec3218db2a16aea30b8c6f71bb9d158da978f98d2 /include
parenta87861e4f88a40705e99c92ce3f01e4c365945de (diff)
downloadexternal_llvm-7aaad71722aeb26f14c8523ee55df91e38837a02.zip
external_llvm-7aaad71722aeb26f14c8523ee55df91e38837a02.tar.gz
external_llvm-7aaad71722aeb26f14c8523ee55df91e38837a02.tar.bz2
Improve performance of PadToColumn by eliminating flushes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77397 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/Support/FormattedStream.h18
1 files changed, 9 insertions, 9 deletions
diff --git a/include/llvm/Support/FormattedStream.h b/include/llvm/Support/FormattedStream.h
index 4b13ff2..a8300b4 100644
--- a/include/llvm/Support/FormattedStream.h
+++ b/include/llvm/Support/FormattedStream.h
@@ -49,13 +49,13 @@ namespace llvm
///
bool DeleteStream;
- /// Column - The current output column of the stream. The column
- /// scheme is zero-based.
+ /// ColumnFlushed - The current output column of the data that's
+ /// been flushed. The column scheme is zero-based.
///
- unsigned Column;
+ unsigned ColumnFlushed;
virtual void write_impl(const char *Ptr, size_t Size) {
- ComputeColumn(Ptr, Size);
+ ComputeColumn(ColumnFlushed);
TheStream->write(Ptr, Size);
}
@@ -67,10 +67,10 @@ namespace llvm
return TheStream->tell() - TheStream->GetNumBytesInBuffer();
}
- /// ComputeColumn - Examine the current output and figure out
- /// which column we end up in after output.
+ /// ComputeColumn - Examine the current buffer and figure out
+ /// which column we're in.
///
- void ComputeColumn(const char *Ptr, size_t Size);
+ void ComputeColumn(unsigned &Column);
public:
/// formatted_raw_ostream - Open the specified file for
@@ -84,11 +84,11 @@ namespace llvm
/// underneath it.
///
formatted_raw_ostream(raw_ostream &Stream, bool Delete = false)
- : raw_ostream(), TheStream(0), DeleteStream(false), Column(0) {
+ : raw_ostream(), TheStream(0), DeleteStream(false), ColumnFlushed(0) {
setStream(Stream, Delete);
}
explicit formatted_raw_ostream()
- : raw_ostream(), TheStream(0), DeleteStream(false), Column(0) {}
+ : raw_ostream(), TheStream(0), DeleteStream(false), ColumnFlushed(0) {}
~formatted_raw_ostream() {
if (DeleteStream)