[patch][rfc] Add pwrite to raw_stream

Rafael EspĂ­ndola rafael.espindola at gmail.com
Thu Apr 9 08:40:54 PDT 2015


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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: t.patch
Type: text/x-patch
Size: 85624 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150409/29951f22/attachment.bin>


More information about the llvm-commits mailing list