[PATCH] D31123: RegisterPressure: Add operators to RegisterMaskPair

Daniel Berlin via llvm-commits llvm-commits at lists.llvm.org
Sun Mar 19 16:58:18 PDT 2017


On Sun, Mar 19, 2017 at 4:00 PM, Axel Davy <axel.davy at ens.fr> wrote:

> Thanks.
>
> This looks like a lot of code just to replace two lines though, should I
> really prefer this code over the previous one ?
>

You template vector_inserter, add it to stlextras, and then everyone can
use it.
:)
(in fact, it really works just as well for any iterator).

As for prefer it, yes, i would generally prefer to express transformations
like you are doing as transforms when possible.

A lot of your code is a series of filters and transforms that just feed
into each other.



> Do you have suggestion to remove the errors when the the constructor
> RegisterMaskPair() is not added ?
>

You are using the operator [] everywhere, which default constructs if the
thing does not exist.
Use .insert and .find
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170319/762afd3f/attachment.html>


More information about the llvm-commits mailing list