diff options
author | Daniel Dunbar <daniel@zuster.org> | 2009-07-29 03:04:22 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2009-07-29 03:04:22 +0000 |
commit | af71a3035b85f5205a3f60de28863e46b184f481 (patch) | |
tree | 503ca10c95f5e4df7b9d4ad6c120c9bef7883021 /llvm/lib/Support/FormattedStream.cpp | |
parent | 1cb8d81b41dc1ce3b270cd470fd9926646ae6438 (diff) | |
download | bcm5719-llvm-af71a3035b85f5205a3f60de28863e46b184f481.tar.gz bcm5719-llvm-af71a3035b85f5205a3f60de28863e46b184f481.zip |
Revert r77397, it causes significant regressions in llc performance.
llvm-svn: 77425
Diffstat (limited to 'llvm/lib/Support/FormattedStream.cpp')
-rw-r--r-- | llvm/lib/Support/FormattedStream.cpp | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/llvm/lib/Support/FormattedStream.cpp b/llvm/lib/Support/FormattedStream.cpp index 1198ebf08e5..1796f9f9568 100644 --- a/llvm/lib/Support/FormattedStream.cpp +++ b/llvm/lib/Support/FormattedStream.cpp @@ -19,11 +19,11 @@ using namespace llvm; /// ComputeColumn - Examine the current output and figure out which /// column we end up in after output. /// -void formatted_raw_ostream::ComputeColumn(unsigned &Column) { +void formatted_raw_ostream::ComputeColumn(const char *Ptr, size_t Size) { // Keep track of the current column by scanning the string for // special characters - for (const char *Ptr = begin(); Ptr != end(); ++Ptr) { + for (const char *epos = Ptr + Size; Ptr != epos; ++Ptr) { ++Column; if (*Ptr == '\n' || *Ptr == '\r') Column = 0; @@ -38,13 +38,8 @@ void formatted_raw_ostream::ComputeColumn(unsigned &Column) { /// \param MinPad - The minimum space to give after the most recent /// I/O, even if the current column + minpad > newcol. /// -void formatted_raw_ostream::PadToColumn(unsigned NewCol, unsigned MinPad) { - // Start out from the last flush position. - unsigned Column = ColumnFlushed; - - // Now figure out what's in the buffer and add it to the column - // count. - ComputeColumn(Column); +void formatted_raw_ostream::PadToColumn(unsigned NewCol, unsigned MinPad) { + flush(); // Output spaces until we reach the desired column. unsigned num = NewCol - Column; |