[patch][rfc] Add pwrite to raw_stream

Rafael EspĂ­ndola rafael.espindola at gmail.com
Thu Apr 9 06:48:22 PDT 2015


> I have an idea that might solve the issue.
>
> In the end, the object writers do want something like a raw_ostream.
> In particular, the efficient non-virtual buffering is just perfect.
>
> What can probably be done is pass a simple raw_ostream to
> LLVMTargetMachine::addPassesToEmitFile and it is its job to wrap it in
> a   formatted_raw_ostream for asm printing and in a
> raw_svector_ostream if needed for object writing.
>
> Trying it out.

The part about creating formatted_raw_ostream seems to work OK. This
patch goes on top of the other two (sorry, odd but convenient for
prototyping).

With this I think I can now pass a stronger type to
addPassesToEmitFile and remove pwrite from the base class. Will try it
out.

Cheers,
Rafael
-------------- next part --------------
A non-text attachment was scrubbed...
Name: t.patch
Type: text/x-patch
Size: 9422 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150409/5d091e23/attachment.bin>


More information about the llvm-commits mailing list