[Patch] Add array support to EndianStream.

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 22 09:49:07 PST 2016


I think I remember now why this wouldn't work - because we wouldn't get any
template type argument deduction if we used ArrayRef. That's unfortunate...

If you just want to support the case where the sequence is written in the
call, you could use an initializer_list argument maybe? (not sure how that
interacts with templates) or a variadic template

On Fri, Jan 22, 2016 at 9:45 AM, David Blaikie <dblaikie at gmail.com> wrote:

> Shooting from the cuff, would it work better to support ArrayRef here
> (which can be implicitly constructed from an array) - that way it'll
> support initializer_list as well (so you can just write "LE.write({0x1234,
> 0x5678})" I think?) & other cases (all the other ArrayRefable things like
> SmallVector, std::vector, etc)
>
> Also, would it make sense to implement the array version in terms of the
> non-array version, rather than doing the byte swapping explicitly here?
>
> On Fri, Jan 22, 2016 at 9:32 AM, Rafael EspĂ­ndola <
> llvm-commits at lists.llvm.org> wrote:
>
>> First, thanks for EndianStream. I am using it in an experiment in lld
>> and it is awesome :-)
>>
>> It is just missing support for arrays, which the attached patch adds.
>> Let me know what you think.
>>
>> Cheers,
>> Rafael
>>
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at lists.llvm.org
>> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160122/a77686b2/attachment.html>


More information about the llvm-commits mailing list