[patch][rfc] Add pwrite to raw_stream

Yaron Keren yaron.keren at gmail.com
Wed Apr 15 03:07:41 PDT 2015


Hi Rafael,

raw_string_ostream is seekable like raw_svector_ostream, should it also
inherit from raw_pwrite_stream?

Yaron


2015-04-09 18:40 GMT+03:00 Rafael EspĂ­ndola <rafael.espindola at gmail.com>:

> On 9 April 2015 at 09:48, Rafael EspĂ­ndola <rafael.espindola at gmail.com>
> wrote:
> >> 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.
>
> That works. Now to see if I can remove classof.
>
> Cheers,
> Rafael
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150415/e2735440/attachment.html>


More information about the llvm-commits mailing list