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

Chandler Carruth via llvm-commits llvm-commits at lists.llvm.org
Sat May 20 19:57:51 PDT 2017


Naming wise, I'd be happy with isa<anyof<...>> or if we can't magic that,
isa_anyof<...>.

On Sat, May 20, 2017 at 8:56 PM Noel Grandin <noelgrandin at gmail.com> wrote:

> 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/49a70431/attachment.html>


More information about the llvm-commits mailing list