[PATCH] Driver: Replace switch cases with ifs.

Rui Ueyama ruiu at google.com
Fri Feb 6 19:11:09 PST 2015


Do you think they still stand?

(a) is a matter of taste, but well, if something can be written using if, I
wouldn't convert it to a switch. (b) is not a matter -- OptTable handles
optional arguments for you. For (c) we didn't do duplication check.

On Fri, Feb 6, 2015 at 7:00 PM, Shankar Kalpathi Easwaran <
shankarke at gmail.com> wrote:

> a) would be easier to add more options, just add another case statement
> b) easy to transition state from one option to another in case of
> positional options.
> c) sometimes specifying the same argument multiple times is invalid, so
> becomes easier to check too.
>
>
> http://reviews.llvm.org/D7478
>
> EMAIL PREFERENCES
>   http://reviews.llvm.org/settings/panel/emailpreferences/
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150206/2768a568/attachment.html>


More information about the llvm-commits mailing list