llvm-project/clang-tools-extra/clang-tidy/readability
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
..
BracesAroundStatementsCheck.cpp [clang-tidy] Force braces around leaf 'else if' for consistency. 2015-06-04 16:36:58 +00:00
BracesAroundStatementsCheck.h [clang-tidy] Force braces around leaf 'else if' for consistency. 2015-06-04 16:36:58 +00:00
CMakeLists.txt [clang-tidy] Add readability-simplify-boolean-expr check to clang-tidy 2015-04-10 19:26:43 +00:00
ContainerSizeEmptyCheck.cpp [clang-tidy] Move user-defined matches to unnamed namespaces to prevent ODR violations. 2015-06-17 13:11:37 +00:00
ContainerSizeEmptyCheck.h [clang-tidy] Refactor: Rename clang-tidy readability check files and classes to follow naming conventions 2015-03-09 12:18:39 +00:00
ElseAfterReturnCheck.cpp clang-tidy: [readability-else-after-return] Fix false positive. This 2015-04-27 22:42:20 +00:00
ElseAfterReturnCheck.h [clang-tidy] Fixed header guards using clang-tidy llvm-header-guard check. NFC. 2015-03-09 16:52:33 +00:00
FunctionSizeCheck.cpp [clang-tidy] Refactor: Rename clang-tidy readability check files and classes to follow naming conventions 2015-03-09 12:18:39 +00:00
FunctionSizeCheck.h [clang-tidy] Refactor: Rename clang-tidy readability check files and classes to follow naming conventions 2015-03-09 12:18:39 +00:00
Makefile
NamedParameterCheck.cpp [clang-tidy] Move google-readability-function check to readability-named-parameter. 2015-03-16 22:31:16 +00:00
NamedParameterCheck.h [clang-tidy] Move google-readability-function check to readability-named-parameter. 2015-03-16 22:31:16 +00:00
NamespaceCommentCheck.cpp [clang-tidy] Fix for http://llvm.org/PR23130 2015-04-08 12:54:57 +00:00
NamespaceCommentCheck.h
ReadabilityTidyModule.cpp [clang-tidy] Add readability-simplify-boolean-expr check to clang-tidy 2015-04-10 19:26:43 +00:00
RedundantSmartptrGetCheck.cpp [clang-tidy] Refactor: Rename clang-tidy readability check files and classes to follow naming conventions 2015-03-09 12:18:39 +00:00
RedundantSmartptrGetCheck.h [clang-tidy] Refactor: Rename clang-tidy readability check files and classes to follow naming conventions 2015-03-09 12:18:39 +00:00
RedundantStringCStrCheck.cpp Move remove-cstr-calls from a standalone executable to a clang-tidy check readability-redundant-string-cstr 2015-03-16 00:32:25 +00:00
RedundantStringCStrCheck.h Move remove-cstr-calls from a standalone executable to a clang-tidy check readability-redundant-string-cstr 2015-03-16 00:32:25 +00:00
ShrinkToFitCheck.cpp [clang-tidy] Move user-defined matches to unnamed namespaces to prevent ODR violations. 2015-06-17 13:11:37 +00:00
ShrinkToFitCheck.h [clang-tidy] Fixed header guards using clang-tidy llvm-header-guard check. NFC. 2015-03-09 16:52:33 +00:00
SimplifyBooleanExprCheck.cpp [clang-tidy] Enhance clang-tidy readability-simplify-boolean-expr... 2015-07-01 12:39:40 +00:00
SimplifyBooleanExprCheck.h [clang-tidy] Enhance clang-tidy readability-simplify-boolean-expr... 2015-07-01 12:39:40 +00:00