llvm-project/clang-tools-extra/clang-tidy/performance
Felix Berger 98e4019a58 [clang-tidy] UnnecessaryCopyInitialization - Extend to trigger on non-const "this" object argument if it is not modified.
Summary:

Also trigger the check in the following case:

void foo() {
  ExpensiveToCopy Obj;
  const auto UnnecessaryCopy = Obj.constReference();
  Obj.onlyUsedAsConst();
}

i.e. when the object the method is called on is not const but is never
modified.

Reviewers: alexfh, fowles

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D20010

llvm-svn: 271239
2016-05-31 00:25:57 +00:00
..
CMakeLists.txt [clang-tidy] Add performance check to flag function parameters of expensive to copy types that can be safely converted to const references. 2016-03-29 02:42:38 +00:00
FasterStringFindCheck.cpp [clang-tidy] Lift common matchers to utils namespace 2016-05-17 19:36:09 +00:00
FasterStringFindCheck.h [clang-tidy] Add check performance-faster-string-find 2016-02-12 19:28:14 +00:00
ForRangeCopyCheck.cpp [clang-tidy] Cleanup namespace in utils folder. 2016-05-03 02:54:05 +00:00
ForRangeCopyCheck.h [clang-tidy] ForRangeCopyCheck that warns on and fixes unnecessary copies of loop variables. 2016-01-29 15:54:26 +00:00
ImplicitCastInLoopCheck.cpp [clang-tidy] Cleaning namespaces to be more consistant across checkers. 2016-05-02 18:00:29 +00:00
ImplicitCastInLoopCheck.h [clang-tidy] Don't use delegating constructors, since they are not supported by MSVC 2013 2016-01-29 17:35:53 +00:00
PerformanceTidyModule.cpp [clang-tidy] Add performance check to flag function parameters of expensive to copy types that can be safely converted to const references. 2016-03-29 02:42:38 +00:00
UnnecessaryCopyInitialization.cpp [clang-tidy] UnnecessaryCopyInitialization - Extend to trigger on non-const "this" object argument if it is not modified. 2016-05-31 00:25:57 +00:00
UnnecessaryCopyInitialization.h [clang-tidy] UnnecessaryCopyInitialization - Extend to trigger on non-const "this" object argument if it is not modified. 2016-05-31 00:25:57 +00:00
UnnecessaryValueParamCheck.cpp [clang-tidy] Cleanup namespace in utils folder. 2016-05-03 02:54:05 +00:00
UnnecessaryValueParamCheck.h [clang-tidy] Add performance check to flag function parameters of expensive to copy types that can be safely converted to const references. 2016-03-29 02:42:38 +00:00