hanchenye-llvm-project/clang-tools-extra/clang-tidy
Gabor Horvath ec87e17c84 [clang-tidy] Misc redundant expressions checker updated for macros
Redundant Expression Checker is updated to be able to detect expressions that
contain macros. Also, other small details are modified to improve the current
implementation.

The improvements in detail are as follows:
* Binary and ternary operator expressions containing two constants, with at
least one of them from a macro, are detected and tested for redundancy.

Macro expressions are treated somewhat differently from other expressions,
because the particular values of macros can vary across builds.
They can be considered correct and intentional, even if macro values equal,
produce ranges that exclude each other or fully overlap, etc. 

* The code structure is slightly modified: typos are corrected,
comments are added and some functions are renamed to improve comprehensibility,
both in the checker and the test file. A few test cases are moved to another
function.

* The checker is now able to detect redundant CXXFunctionalCastExprs as well.
A corresponding test case is added.

Patch by: Lilla Barancsuk!

Differential Revision: https://reviews.llvm.org/D38688

llvm-svn: 317570
2017-11-07 13:17:58 +00:00
..
android [clang-tidy] Remove unused static variable. 2017-08-16 21:00:06 +00:00
boost [clang-tidy] boost-use-to-string arg expr location bugfix 2016-06-28 08:16:20 +00:00
bugprone [clang-tidy] bugprone-undefined-memory-manipulation: include type into the message 2017-08-24 12:11:05 +00:00
cert [clang-tidy] When" -fno-exceptions is used", this warning is better to be suppressed. 2017-06-07 17:41:59 +00:00
cppcoreguidelines [clang-tidy] introduce legacy resource functions to 'cppcoreguidelines-owning-memory' 2017-10-18 16:14:15 +00:00
google Add new check in google module for Objective-C code to ensure global variables follow the naming convention of Google Objective-C Style Guide 2017-11-07 08:53:37 +00:00
hicpp [clang-tidy] Fix bug 34845, offending standard bitmask types 2017-10-27 14:44:08 +00:00
llvm [clang-tidy] Unify the way IncludeStyle and HeaderFileExtesions options are used 2017-07-20 12:02:03 +00:00
misc [clang-tidy] Misc redundant expressions checker updated for macros 2017-11-07 13:17:58 +00:00
modernize [clang-tidy] A follow-up fix of braced-init-list constructors in make-unique check. 2017-08-24 13:35:55 +00:00
mpi modernize-use-auto NFC fixes 2016-12-14 15:29:23 +00:00
objc [clang-tidy ObjC] [3/3] New check objc-forbidden-subclassing 2017-10-27 07:41:36 +00:00
performance [clang-tidy] 'implicit cast' -> 'implicit conversion' 2017-08-08 14:53:52 +00:00
plugin [clang-tidy ObjC] [1/3] New module `objc` for Objective-C checks 2017-10-26 08:23:20 +00:00
readability Revert "Fix nested namespaces in google-readability-nested-namespace-comments." 2017-10-12 14:25:16 +00:00
tool [clang-tidy] Support relative paths in run-clang-tidy.py 2017-11-06 10:36:02 +00:00
utils [clang-tidy] Implement type-based check for `gsl::owner` 2017-09-12 20:00:42 +00:00
CMakeLists.txt [clang-tidy ObjC] [1/3] New module `objc` for Objective-C checks 2017-10-26 08:23:20 +00:00
ClangTidy.cpp Change getChecksFilter() interface to hide implementation details. 2017-05-17 14:39:47 +00:00
ClangTidy.h [clang-tidy] Add FormatStyle configuration option. 2017-04-06 13:41:29 +00:00
ClangTidyDiagnosticConsumer.cpp [clang-tidy] Ignore newlines in checks list 2017-08-09 16:00:31 +00:00
ClangTidyDiagnosticConsumer.h [clang-tidy] Optimize GlobList::contains 2017-05-18 01:13:51 +00:00
ClangTidyModule.cpp Change getChecksFilter() interface to hide implementation details. 2017-05-17 14:39:47 +00:00
ClangTidyModule.h [clang-tools-extra] Format sources with clang-format. NFC. 2016-11-08 07:50:19 +00:00
ClangTidyModuleRegistry.h Reapply r276973 "Adjust Registry interface to not require plugins to export a registry" 2016-08-05 11:01:08 +00:00
ClangTidyOptions.cpp Fix ODR violations due to abuse of LLVM_YAML_IS_(FLOW_)?SEQUENCE_VECTOR 2017-06-30 20:57:16 +00:00
ClangTidyOptions.h [clang-tidy] Add FormatStyle configuration option. 2017-04-06 13:41:29 +00:00
add_new_check.py [clang-tidy] add_new_check.py updates ReleaseNotes.rst now 2017-07-12 13:13:41 +00:00
rename_check.py [clang-tidy] Improve rename_check.py. 2016-11-08 11:43:50 +00:00