[llvm] r234535 - Simplify use of formatted_raw_ostream.

Rafael EspĂ­ndola rafael.espindola at gmail.com
Thu Jun 11 09:12:54 PDT 2015


> Interesting idea. I wonder why we went with disabling the buffer of
> the passed stream. I will take a look at git log and play with the
> idea of flipping it.

The attached patch changes the buffering as you suggested.

One of the issues is that it is slower. The outer caching is
non-virtual. Running

llvm-mc all-of-clang-lto.s -o /dev/null

goes from 0m22.230s to 0m23.673s on my laptop. Do we care?

The other issues are:

* test/CodeGen/R600/cf-stack-bug.ll fails because it uses 2>&1 and so
depends on the buffering differences of stdout and stderr :-(

* A hack in r600 to pad to a column:

void AMDGPUInstPrinter::printLast(const MCInst *MI, unsigned OpNo,
                                  raw_ostream &O) {
  printIfSet(MI, OpNo, O.indent(25 - O.GetNumBytesInBuffer()), "*", " ");
}

since now GetNumBytesInBuffer is 0.

The issue can be fixed by giving up on aligning the "*" or passing in
a formatted_raw_stream that actually knows the current column.

The other attached patch is a start at passing a formatted_raw_steam,
but it might not be necessary.

Cheers,
Rafael
-------------- next part --------------
A non-text attachment was scrubbed...
Name: t.patch
Type: application/octet-stream
Size: 1689 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150611/55d45e25/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: formatted.patch
Type: application/octet-stream
Size: 31433 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150611/55d45e25/attachment-0001.obj>


More information about the llvm-commits mailing list