[clang-tidy] White List Option for performance-unnecessary-value-param, performance...
authorAdam Balogh <adam.balogh@ericsson.com>
Fri, 12 Oct 2018 13:05:21 +0000 (13:05 +0000)
committerAdam Balogh <adam.balogh@ericsson.com>
Fri, 12 Oct 2018 13:05:21 +0000 (13:05 +0000)
commitabd72e9851b25185331a812ce21187f78240ec03
tree907b8fd15a66e521e3490c33f052c5e0e5b3b54f
parentb7f120f07165b462794711c470e188374e377991
[clang-tidy] White List Option for performance-unnecessary-value-param, performance-unnecessary-copy-initialization and performance-for-range-copy

New option added to these three checks to be able to silence false positives on
types that are intentionally passed by value or copied. Such types are e.g.
intrusive reference counting pointer types like llvm::IntrusiveRefCntPtr. The
new option is named WhiteListTypes and can contain a semicolon-separated list of
names of these types. Regular expressions are allowed. Default is empty.

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

llvm-svn: 344340
13 files changed:
clang-tools-extra/clang-tidy/performance/ForRangeCopyCheck.cpp
clang-tools-extra/clang-tidy/performance/ForRangeCopyCheck.h
clang-tools-extra/clang-tidy/performance/UnnecessaryCopyInitialization.cpp
clang-tools-extra/clang-tidy/performance/UnnecessaryCopyInitialization.h
clang-tools-extra/clang-tidy/performance/UnnecessaryValueParamCheck.cpp
clang-tools-extra/clang-tidy/performance/UnnecessaryValueParamCheck.h
clang-tools-extra/clang-tidy/utils/Matchers.h
clang-tools-extra/docs/clang-tidy/checks/performance-for-range-copy.rst
clang-tools-extra/docs/clang-tidy/checks/performance-unnecessary-copy-initialization.rst
clang-tools-extra/docs/clang-tidy/checks/performance-unnecessary-value-param.rst
clang-tools-extra/test/clang-tidy/performance-for-range-copy-allowed-types.cpp [new file with mode: 0644]
clang-tools-extra/test/clang-tidy/performance-unnecessary-copy-initialization-allowed-types.cpp [new file with mode: 0644]
clang-tools-extra/test/clang-tidy/performance-unnecessary-value-param-allowed-types.cpp [new file with mode: 0644]