summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
Diffstat (limited to 'llvm')
-rw-r--r--llvm/include/llvm/Support/FormattedStream.h5
-rw-r--r--llvm/lib/Support/FormattedStream.cpp11
2 files changed, 1 insertions, 15 deletions
diff --git a/llvm/include/llvm/Support/FormattedStream.h b/llvm/include/llvm/Support/FormattedStream.h
index 3a872058c9d..768b8ed0eed 100644
--- a/llvm/include/llvm/Support/FormattedStream.h
+++ b/llvm/include/llvm/Support/FormattedStream.h
@@ -33,11 +33,6 @@ namespace llvm
///
const static bool PRESERVE_STREAM = false;
- /// MAX_COLUMN_PAD - This is the maximum column padding we ever
- /// expect to see.
- ///
- const static unsigned MAX_COLUMN_PAD = 100;
-
private:
/// TheStream - The real stream we output to. We set it to be
/// unbuffered, since we're already doing our own buffering.
diff --git a/llvm/lib/Support/FormattedStream.cpp b/llvm/lib/Support/FormattedStream.cpp
index 4e624275300..70f2cfa6ae8 100644
--- a/llvm/lib/Support/FormattedStream.cpp
+++ b/llvm/lib/Support/FormattedStream.cpp
@@ -63,16 +63,7 @@ void formatted_raw_ostream::PadToColumn(unsigned NewCol) {
ComputeColumn(getBufferStart(), GetNumBytesInBuffer());
// Output spaces until we reach the desired column.
- unsigned num = NewCol - ColumnScanned;
- if (NewCol < ColumnScanned || num < 1)
- num = 1;
-
- // Keep a buffer of spaces handy to speed up processing.
- const char *Spaces = " "
- " ";
-
- assert(num < MAX_COLUMN_PAD && "Unexpectedly large column padding");
- write(Spaces, num);
+ indent(std::max(int(NewCol - ColumnScanned), 1));
}
void formatted_raw_ostream::write_impl(const char *Ptr, size_t Size) {
OpenPOWER on IntegriCloud