[PATCH] Refactor: Simplify boolean expressions in lib/AST

Daniel Jasper djasper at google.com
Mon Mar 23 23:30:00 PDT 2015


I don't feel strongly about this, and I can see some of your reasoning.
However, an "if (a) return true; else return false;" is very suspect to me
and I think "return a;" is more readable, independent of whether it is at
the end of a chain or not.

However, there is an underlying issue here. The existing code is violating
LLVM's coding standard of "don't use else after return" (
http://llvm.org/docs/CodingStandards.html#don-t-use-else-after-a-return).
So in these chains, all of the "else"s should be removed.

On Tue, Mar 24, 2015 at 7:17 AM, Richard <legalize at xmission.com> wrote:

> Thanks for your ideas, John, I'm going to incorporate this into the
> `clang-tidy` check.
>
>
> http://reviews.llvm.org/D8532
>
> EMAIL PREFERENCES
>   http://reviews.llvm.org/settings/panel/emailpreferences/
>
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20150324/decae288/attachment.html>


More information about the cfe-commits mailing list