llvm-project/clang-tools-extra/clang-tidy/performance
Haojian Wu 25efa0fad3 [clang-tidy] Omit cases where loop variable is not used in loop body in
performance-for-range-copy check.

Summary:
The upstream change r336737 make the check too smart to fix the case
where loop variable could be used as `const auto&`.

But for the case below, changing to `const auto _` will introduce
an unused complier warning.

```
for (auto _ : state) {
  // no references for _.
}
```

This patch omit this case, and it is safe to do it as the case is very rare.

Reviewers: ilya-biryukov, alexfh

Subscribers: xazax.hun, cfe-commits

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

llvm-svn: 339415
2018-08-10 08:25:51 +00:00
..
CMakeLists.txt [clang-tidy] Move more checks from misc- to performance- 2017-11-28 16:41:03 +00:00
FasterStringFindCheck.cpp Port getLocEnd -> getEndLoc 2018-08-09 22:43:02 +00:00
FasterStringFindCheck.h [clang-tidy] Add check performance-faster-string-find 2016-02-12 19:28:14 +00:00
ForRangeCopyCheck.cpp [clang-tidy] Omit cases where loop variable is not used in loop body in 2018-08-10 08:25:51 +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
ImplicitConversionInLoopCheck.cpp Port getLocStart -> getBeginLoc 2018-08-09 22:42:26 +00:00
ImplicitConversionInLoopCheck.h Add support for arrays in performance-implicit-conversion-in-loop 2018-06-11 12:46:48 +00:00
InefficientAlgorithmCheck.cpp Port getLocStart -> getBeginLoc 2018-08-09 22:42:26 +00:00
InefficientAlgorithmCheck.h [clang-tidy] Move checks from misc- to performance- 2017-11-27 13:06:28 +00:00
InefficientStringConcatenationCheck.cpp Adapt clang-tidy checks to changing semantics of hasDeclaration. 2017-08-02 13:13:11 +00:00
InefficientStringConcatenationCheck.h [clang-tidy] Inefficient string operation 2016-08-03 23:06:03 +00:00
InefficientVectorOperationCheck.cpp Port getLocStart -> getBeginLoc 2018-08-09 22:42:26 +00:00
InefficientVectorOperationCheck.h [clang-tidy] Support detecting for-range loop in inefficient-vector-operation check. 2017-04-26 18:13:05 +00:00
MoveConstArgCheck.cpp Port getLocEnd -> getEndLoc 2018-08-09 22:43:02 +00:00
MoveConstArgCheck.h [clang-tidy] Move more checks from misc- to performance- 2017-11-28 16:41:03 +00:00
MoveConstructorInitCheck.cpp [clang-tidy] Move checks from misc- to performance- 2017-11-27 13:06:28 +00:00
MoveConstructorInitCheck.h [clang-tidy] Move checks from misc- to performance- 2017-11-27 13:06:28 +00:00
NoexceptMoveConstructorCheck.cpp Update to match clang r331428. 2018-05-03 03:59:50 +00:00
NoexceptMoveConstructorCheck.h [clang-tidy] Move more checks from misc- to performance- 2017-11-28 16:41:03 +00:00
PerformanceTidyModule.cpp [clang-tidy] Move more checks from misc- to performance- 2017-11-28 16:41:03 +00:00
TypePromotionInMathFnCheck.cpp Port getLocStart -> getBeginLoc 2018-08-09 22:42:26 +00:00
TypePromotionInMathFnCheck.h [clang-tidy] Suggest including <cmath> if necessary in type-promotion-in-math-fn-check. 2016-12-14 06:52:23 +00:00
UnnecessaryCopyInitialization.cpp [clang-tools-extra] Format sources with clang-format. NFC. 2016-11-08 07:50:19 +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 Port getLocStart -> getBeginLoc 2018-08-09 22:42:26 +00:00
UnnecessaryValueParamCheck.h [clang-tidy] UnnecessaryValueParamCheck - suggest std::move() if non-const value parameter can be moved. 2016-07-01 20:12:15 +00:00