llvm-project/clang-tools-extra/clang-tidy
Alexander Kornienko 6ae400d122 [clang-tidy] Enhance clang-tidy readability-simplify-boolean-expr...
Enhance clang-tidy readability-simplify-boolean-expr to handle 'if (e) return
true; return false;' and improve replacement expressions.

This changeset extends the simplify boolean expression check in clang-tidy to
simplify if (e) return true; return false; to return e; (note the lack of an
else clause on the if statement.) By default, chained conditional assignment is
left unchanged, unless a configuration parameter is set to non-zero to override
this behavior.

It also improves the handling of replacement expressions to apply
static_cast<bool>(expr) when expr is not of type bool.

http://reviews.llvm.org/D9810

Patch by Richard Thomson!

llvm-svn: 241155
2015-07-01 12:39:40 +00:00
..
google [clang-tidy] Move user-defined matches to unnamed namespaces to prevent ODR violations. 2015-06-17 13:11:37 +00:00
llvm [clang-tidy] Refactor: Move llvm clang-tidy checks to namespace clang::tidy::llvm 2015-03-02 12:39:18 +00:00
misc [clang-tidy] Fix false positives in the macro parentheses checker 2015-06-29 12:18:11 +00:00
readability [clang-tidy] Enhance clang-tidy readability-simplify-boolean-expr... 2015-07-01 12:39:40 +00:00
tool Make helpers static. clang-tools edition. 2015-03-23 12:49:15 +00:00
utils Update to match clang r236404. 2015-05-04 03:15:55 +00:00
CMakeLists.txt [CMake] Add dependencies on clangToolingCore. 2014-10-30 00:44:01 +00:00
ClangTidy.cpp [clang-tidy] Static Analyzer checker configuration options pass-through. 2015-03-11 17:25:22 +00:00
ClangTidy.h [clang-tidy] Disable google-readability-casting for .c files and their headers. 2015-05-21 14:08:56 +00:00
ClangTidyDiagnosticConsumer.cpp [clang-tidy] Count errors in ClangTidyDiagnosticConsumer 2014-11-20 12:05:51 +00:00
ClangTidyDiagnosticConsumer.h [clang-tidy] Disable google-readability-casting for .c files and their headers. 2015-05-21 14:08:56 +00:00
ClangTidyModule.cpp [clang-tidy] Default options in modules. 2014-10-16 11:27:57 +00:00
ClangTidyModule.h [clang-tidy] Fixed header guards using clang-tidy llvm-header-guard check. NFC. 2015-03-09 16:52:33 +00:00
ClangTidyModuleRegistry.h [clang-tidy] Fixed header guards using clang-tidy llvm-header-guard check. NFC. 2015-03-09 16:52:33 +00:00
ClangTidyOptions.cpp [clang-tidy] Don't ignore default set of checks when a config file is found. 2015-02-05 14:50:17 +00:00
ClangTidyOptions.h [clang-tidy] Fixed header guards using clang-tidy llvm-header-guard check. NFC. 2015-03-09 16:52:33 +00:00
Makefile Add NamespaceCommentCheck to the Google module. 2014-09-22 10:41:39 +00:00
add_new_check.py [clang-tidy] Extended the example check, added a fix-it, etc. 2014-12-09 12:43:09 +00:00