Go to file
Alexander Kornienko f5e72b0448 [clang-tidy] Add readability-simplify-boolean-expr check to clang-tidy
This check looks for comparisons between boolean expressions and boolean
constants and simplifies them to just use the appropriate boolean expression
directly.

if (b == true) becomes if (b)
if (b == false) becomes if (!b)
if (b && true) becomes if (b)
if (b && false) becomes if (false)
if (b || true) becomes if (true)
if (b || false) becomes if (b)
e ? true : false becomes e
e ? false : true becomes !e
if (true) t(); else f(); becomes t();
if (false) t(); else f(); becomes f();
if (e) return true; else return false; becomes return (e);
if (e) return false; else return true; becomes return !(e);
if (e) b = true; else b = false; becomes b = e;
if (e) b = false; else b = true; becomes b = !(e);

http://reviews.llvm.org/D7648

Patch by Richard Thomson!

llvm-svn: 234626
2015-04-10 19:26:43 +00:00
clang Don't eagerly typo-correct to a keyword if the next token is a right paren. 2015-04-10 19:16:46 +00:00
clang-tools-extra [clang-tidy] Add readability-simplify-boolean-expr check to clang-tidy 2015-04-10 19:26:43 +00:00
compiler-rt [ASan] Use a better name for a function parameter 2015-04-10 15:31:16 +00:00
debuginfo-tests New round of fixes for "Always compile debuginfo-tests for the host triple" 2014-10-18 23:47:59 +00:00
libclc Implement atanh builtin 2015-04-07 16:20:22 +00:00
libcxx In many places, there was an #ifdef/#else block that selected one of two implmentations of rebind_alloc based on whether or not we had template aliases. Create a helper struct to encapsulate that bit of logic, and replace all the ifdefs with uses of that struct. No functionality change intented. 2015-04-07 05:21:38 +00:00
libcxxabi [libcxxabi] Disallow Base to Derived conversions for catching pointers to members. 2015-04-06 23:03:01 +00:00
lld [ARM] Implement PLT for dynamic pass 2015-04-10 11:41:27 +00:00
lldb [TestFormatters, TestDataFormatterSynthVal] Mark as xfail. 2015-04-10 19:25:50 +00:00
llgo [llgo] add buildbot-slave config 2015-04-08 01:41:46 +00:00
llvm use update_llc_test_checks.py to tighten checking 2015-04-10 18:31:42 +00:00
openmp Replace some unsafe API calls with safe alternatives on Windows, prepare code for similar actions on other platforms - wrap unsafe API calls into macros. 2015-04-02 13:27:08 +00:00
polly Drop ISL_INSTALL path 2015-04-10 15:41:14 +00:00