[PATCH] D33125: Introduce isoneof<T0, T1, ...> as an extension of isa<T>

Noel Grandin via llvm-commits llvm-commits at lists.llvm.org
Sat May 20 19:56:06 PDT 2017


isa_oneof? isa_anyof?
On Sun, 21 May 2017 at 01:57, Sanjoy Das via Phabricator <
reviews at reviews.llvm.org> wrote:

> sanjoy added a comment.
>
> In https://reviews.llvm.org/D33125#760296, @chandlerc wrote:
>
> > Another high-level comment: I don't like the name `isoneof`. To me, that
> parses to the relationship being tested `is` rather than `isa` which loses
> an important distinction. I'm not really sure what would be the best name
> though.
>
>
> One possibility is to figure out the C++ to make code like this work:
>
>   if (isa<oneof<T0, T1, T2>>(X))
>     ...;
>
> That's a bit more verbose, but we can read `oneof<T0, T1, T2>` as a sum
> type of `T0`, `T1` and `T2`.  I'd even be up for calling it `sum` or
> `sumty`, but not sure how others feel about that.
>
>
> Repository:
>   rL LLVM
>
> https://reviews.llvm.org/D33125
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170521/bbbf2dd8/attachment.html>


More information about the llvm-commits mailing list