[PATCH] D20724: [pdb] Apply zero-copy algorithms to symbol stream iteration

Zachary Turner via llvm-commits llvm-commits at lists.llvm.org
Fri May 27 08:17:28 PDT 2016


Ahh, I didn't do this because I imagined cases where you might want
ValueType to be something you can't change like ArrayRef, or have 2
different VarStreamArrays both with the same ValueType but using a
different algorithm to extract them. Currently we don't but I thought we
might need it later
On Fri, May 27, 2016 at 8:14 AM Rui Ueyama <ruiu at google.com> wrote:

> ruiu added a comment.
>
> I mean it seems you can define `static uint32_t extract(const
> StreamInterface &Stream, CVRecord &Item)` for CVRecord class and template
> VarStreamArray with CVRecord (instead of the traits class).
>
> So you are currently doing this.
>
>   VarStreamArrayIterator(const VarStreamArray<TraitsType> &Array)
>       : Array(&Array), IterRef(Array.Stream) {
>     ThisLen = TraitsType::extract(IterRef, ThisValue);
>   }
>
> But looks like it can be written like this if you remove the template
> class and directly use CVRecord class.
>
>   VarStreamArrayIterator(const VarStreamArray<T> &Array)
>       : Array(&Array), IterRef(Array.Stream) {
>     ThisLen = T::extract(IterRef, ThisValue);
>   }
>
> no?
>
>
> http://reviews.llvm.org/D20724
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160527/b888c0e6/attachment.html>


More information about the llvm-commits mailing list