llvm.org GIT mirror llvm / de51ded
switch formattedstream to use raw_ostream::indent. This eliminates the weird MAX_COLUMN_PAD limitation. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79785 91177308-0d34-0410-b5e6-96231b3b80d8 Chris Lattner 10 years ago
2 changed file(s) with 1 addition(s) and 15 deletion(s). Raw diff Collapse all Expand all
3131 /// stream.
3232 ///
3333 const static bool PRESERVE_STREAM = false;
34
35 /// MAX_COLUMN_PAD - This is the maximum column padding we ever
36 /// expect to see.
37 ///
38 const static unsigned MAX_COLUMN_PAD = 100;
3934
4035 private:
4136 /// TheStream - The real stream we output to. We set it to be
6262 ComputeColumn(getBufferStart(), GetNumBytesInBuffer());
6363
6464 // Output spaces until we reach the desired column.
65 unsigned num = NewCol - ColumnScanned;
66 if (NewCol < ColumnScanned || num < 1)
67 num = 1;
68
69 // Keep a buffer of spaces handy to speed up processing.
70 const char *Spaces = " "
71 " ";
72
73 assert(num < MAX_COLUMN_PAD && "Unexpectedly large column padding");
74 write(Spaces, num);
65 indent(std::max(int(NewCol - ColumnScanned), 1));
7566 }
7667
7768 void formatted_raw_ostream::write_impl(const char *Ptr, size_t Size) {