[PATCH] D24882: Add StringSwitch::Cases functions that takes 6, 7 or 8 arguments.

Zachary Turner via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 23 14:07:35 PDT 2016


I wonder if it's time to simplify these functions. There's no reason each
function has to repeat the entire if statement.

It seems each function could be

if (!Result)
return Case(S0).Cases(S1, ...);
return *this;

Then the memcmp is only in one function and all other functions become
really short
On Fri, Sep 23, 2016 at 1:37 PM Rui Ueyama <ruiu at google.com> wrote:

> ruiu created this revision.
> ruiu added a reviewer: zturner.
> ruiu added a subscriber: llvm-commits.
>
> I wanted a Cases function that takes 6 parameters, so I added a few more.
>
> https://reviews.llvm.org/D24882
>
> Files:
>   include/llvm/ADT/StringSwitch.h
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160923/ef3bbb07/attachment.html>


More information about the llvm-commits mailing list