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

Richard legalize at xmission.com
Mon Mar 23 22:39:19 PDT 2015


Thanks for your feedback John, this is very helpful in improving this check.

In http://reviews.llvm.org/D8532#145845, @rjmccall wrote:

> [...] Why would we want to do this?


So basically you're saying the tool is reporting a false positive for code that is of the form `if (e) return true; else return false;` when this code fragment appears as the last in a series if `if`/`else if` clauses?

When it is a single instance of that code fragment, you don't have a problem with it?

If that understanding is correct, then I can see that this might be a matter of style or preference.  This is a readability check, after all, and most things in readability have some aspect of a subjective viewpoint.

If the default behavior were to not consider such clauses when they are at the end of a larget if/else clause and there was an option for including those cases as well, would that address the issue?


http://reviews.llvm.org/D8532

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the cfe-commits mailing list