[llvm] r234535 - Simplify use of formatted_raw_ostream.
Rafael Espíndola
rafael.espindola at gmail.com
Thu Jun 11 14:56:44 PDT 2015
>> That still puts the output in a file and will buffer the same.
>
> llvm-mc conditionally buffers the output based on:
>
>
> if (!Out->os().supportsSeeking()) {
> BOS = make_unique<buffer_ostream>(Out->os());
> OS = BOS.get();
> }
>
> Redirecting to a file is not the same from the producer point of view, my thought was that stdout would not “supportsSeeking()“ and llvm-mc would add the buffering.
Yes, but with "-o - > foo", supportSeeking returns true for stdout.
>> BTW, at which point do you need to access the generated assembly?
>> Could MCAsmStreamer::FinishImpl flush the stream?
>
> When PassManager.run() finishes I expect my stream to be populated. If MCAsmStreamer::FinishImpl is called at the end of the process, that’s fine with me.
It should be. Can you give that a try? A patch doing that LGMT since
it is quite a bit less invasive than switching the buffering.
Cheers,
Rafael
More information about the llvm-commits
mailing list