<div dir="ltr">Sorry I'm late to the party, but I think I agree with Sean.<br><br>This makes absolutely no sense to me on the raw_ostream interface. That interface is entirely about streaming output. <span style="line-height:1.5;font-size:13.1999998092651px">I don't think the seek interface makes any sense either honestly.</span><div><span style="line-height:1.5;font-size:13.1999998092651px"><br></span></div><div><span style="line-height:1.5;font-size:13.1999998092651px">I think the right way to layer these things is the other way around. Build the abstraction you want for IO, but don't tie it to raw_ostream in any way. You could make it *also* implement the raw_ostream interface if you want so that you can use it in that context, but I don't know why raw_ostream would ever be aware of this.</span></div></div><br><div class="gmail_quote">On Wed, Apr 8, 2015 at 6:46 PM Rafael Espíndola <<a href="mailto:rafael.espindola@gmail.com">rafael.espindola@gmail.com</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 8 April 2015 at 21:06, Sean Silva <<a href="mailto:chisophugis@gmail.com" target="_blank">chisophugis@gmail.com</a>> wrote:<br>
><br>
><br>
> On Wed, Apr 8, 2015 at 5:35 PM, Rafael Espíndola<br>
> <<a href="mailto:rafael.espindola@gmail.com" target="_blank">rafael.espindola@gmail.com</a>> wrote:<br>
>><br>
>> On 8 April 2015 at 20:25, Sean Silva <<a href="mailto:chisophugis@gmail.com" target="_blank">chisophugis@gmail.com</a>> wrote:<br>
>> > It stops being a "stream" when you add the ability to write at a<br>
>> > specified<br>
>> > offset. It's like adding operator+= to something with "outputiterator"<br>
>> > in<br>
>> > the name. Is there a reason that this has to live inside raw_ostream?<br>
>><br>
>> The object writer has to write to something. It can do it better if<br>
>> that something supports at least pwrite.<br>
><br>
><br>
> Well, it's not only that; it just seems to sort of violate the whole idea of<br>
> raw_ostream:<br>
><br>
> 00035 /// raw_ostream - This class implements an extremely fast bulk output<br>
> stream<br>
> 00036 /// that can *only* output to a stream.  It does not support seeking,<br>
> reopening,<br>
> 00037 /// rewinding, line buffered disciplines etc. It is a simple buffer<br>
> that outputs<br>
> 00038 /// a chunk at a time.<br>
><br>
><br>
> I think it would be better to not tie this directly into raw_ostream.<br>
<br>
I can update the comment to say that some of the base classes support<br>
pwrite. Note that raw_fd_stream already supports seek.<br>
<br>
But there is a practical need for a stream_with_pwrite and it can be<br>
added to the classes we need without violation the *reason* that<br>
comment exists: raw_ostream has to be fast.<br>
<br>
Cheers,<br>
Rafael<br>
<br>
______________________________<u></u>_________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu" target="_blank">llvm-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/<u></u>mailman/listinfo/llvm-commits</a><br>
</blockquote></div>