llvm-project/clang-tools-extra/clang-tidy
Greg Miller d038faea46 [clang-tidy] add option performance-move-const-arg.CheckMoveToConstRef
This option allows callers to disable the warning from
https://clang.llvm.org/extra/clang-tidy/checks/performance-move-const-arg.html
that would warn on the following

```
void f(const string &s);
string s;
f(std::move(s));  // ALLOWED if performance-move-const-arg.CheckMoveToConstRef=false
```

The reason people might want to disable this check, is because it allows
callers to use `std::move()` or not based on local reasoning about the
argument, and without having to care about how the function `f` accepts
the argument. Indeed, `f` might accept the argument by const-ref today,
but change to by-value tomorrow, and if the caller had moved the
argument that they were finished with, the code would work as
efficiently as possible regardless of how `f` accepted the parameter.

Reviewed By: ymandel

Differential Revision: https://reviews.llvm.org/D119370
2022-02-10 13:31:07 +00:00
..
abseil [clang-tidy] Use cast<>/castAs<> instead of dyn_cast<>/getAs<> to avoid dereference of nullptr 2022-01-23 12:57:12 +00:00
altera [clang-tidy] Fix crashing altera-struct-pack-align on invalid RecordDecls 2021-11-29 09:56:43 +01:00
android Use StringRef::contains (NFC) 2021-12-24 22:05:34 -08:00
boost [openmp] Add missing dependencies for OMP.h.inc after d90443b 2020-06-23 11:48:04 -04:00
bugprone [clang-tidy] Fixed a compile warning (NFC). 2022-02-07 14:56:27 +01:00
cert [NFC] Fix endif comments to match with include guard 2022-01-07 15:52:59 +08:00
concurrency [clang-tidy] Add new check 'concurrency-thread-canceltype-asynchronous' and alias 'cert-pos47-c'. 2021-02-22 12:42:20 +01:00
cppcoreguidelines [clang-tidy] Remove gsl::at suggestion from cppcoreguidelines-pro-bounds-constant-array-index 2022-01-23 15:52:42 +00:00
darwin [openmp] Add missing dependencies for OMP.h.inc after d90443b 2020-06-23 11:48:04 -04:00
fuchsia Fix false positives in `fuchsia-trailing-return` check involving deduction guides 2021-12-01 15:28:01 -05:00
google Reland "[AST] Add UsingType: a sugar type for types found via UsingDecl" 2021-12-20 18:03:15 +01:00
hicpp [clang-tidy] Applied clang-tidy fixes. NFC 2021-01-29 01:01:19 +01:00
linuxkernel [openmp] Add missing dependencies for OMP.h.inc after d90443b 2020-06-23 11:48:04 -04:00
llvm [clang-tidy] Fix LLVM include order check policy 2022-02-03 17:32:43 +01:00
llvmlibc Remove redundant return and continue statements (NFC) 2021-12-24 23:17:54 -08:00
misc Don't trigger unused-parameter warnings on naked functions 2022-01-27 11:40:08 -05:00
modernize [C++2b] Implement multidimentional subscript operator 2022-02-08 12:10:47 -05:00
mpi [clang-tidy][NFC] replace some redundant std::string creations 2022-01-19 18:36:35 +00:00
objc [clang-tidy][objc] Finds and fixes improper usages of XCTAssertEquals and XCTAssertNotEquals. 2021-12-02 18:32:16 -05:00
openmp [clang-tidy][NFC] Remove unnecessary includes throughout clang-tidy header files 2020-06-29 16:05:52 +01:00
performance [clang-tidy] add option performance-move-const-arg.CheckMoveToConstRef 2022-02-10 13:31:07 +00:00
plugin [clang-tidy] Fix lint warnings in clang-tidy source code (NFC) 2021-11-02 20:14:25 +13:00
portability [clang-tidy][NFC] Tweak some generation of diag messages 2021-02-26 19:10:25 +00:00
readability [clang-tidy] Make header compile standalone. NFC. 2022-01-31 11:18:00 +01:00
tool Make run-clang-tidy.py print the configured checks correctly 2022-02-08 08:32:04 -05:00
utils [clang-tidy] Include constructor initializers in `bugprone-exception-escape` check 2022-01-21 00:53:57 +01:00
zircon Remove references to the ast_type_traits namespace 2020-12-11 00:58:46 +01:00
CMakeLists.txt Re-land "Cache the locations of NOLINTBEGIN/END blocks" with fix for build bot 2022-01-27 01:03:27 +13:00
ClangTidy.cpp [clang-tidy] Fix lint warnings in clang-tidy source code (NFC) 2021-11-02 20:14:25 +13:00
ClangTidy.h [clang-tidy] Fix lint warnings in clang-tidy source code (NFC) 2021-11-02 20:14:25 +13:00
ClangTidyCheck.cpp [clang-tidy] Add new case type to check variables with Hungarian notation 2021-08-01 15:22:17 -07:00
ClangTidyCheck.h [clang-tools-extra] Remove unused forward declarations (NFC) 2022-01-30 16:05:00 -08:00
ClangTidyDiagnosticConsumer.cpp Re-land "Cache the locations of NOLINTBEGIN/END blocks" with fix for build bot 2022-01-27 01:03:27 +13:00
ClangTidyDiagnosticConsumer.h [clang-tools-extra] Remove unused forward declarations (NFC) 2022-01-30 16:05:00 -08:00
ClangTidyForceLinker.h [clang-tidy] add concurrency module 2020-11-30 12:27:17 +03:00
ClangTidyModule.cpp [clang-tidy][NFC] Use StringMap for ClangTidyCheckFactories::FacoryMap 2020-07-30 22:57:33 +01:00
ClangTidyModule.h [clang-tidy][NFC] Remove unnecessary headers 2020-12-28 15:01:51 +00:00
ClangTidyModuleRegistry.h
ClangTidyOptions.cpp [clang-tidy] Applied clang-tidy fixes. NFC 2021-01-29 01:01:19 +01:00
ClangTidyOptions.h [clang-tidy] Fix lint warnings in clang-tidy source code (NFC) 2021-11-02 20:14:25 +13:00
ClangTidyProfiling.cpp [clang-tidy][NFC] Remove unnecessary headers 2020-12-28 15:01:51 +00:00
ClangTidyProfiling.h [clang-tidy][NFC] Remove unnecessary includes throughout clang-tidy header files 2020-06-29 16:05:52 +01:00
ExpandModularHeadersPPCallbacks.cpp [clang] Let PPCallbacks::PragmaWarning() pass specifier as enum instead of string 2021-09-28 19:47:27 -04:00
ExpandModularHeadersPPCallbacks.h [clang] Let PPCallbacks::PragmaWarning() pass specifier as enum instead of string 2021-09-28 19:47:27 -04:00
GlobList.cpp Add missing include llvm/ADT/STLExtras 2022-01-24 14:41:24 +01:00
GlobList.h [clang-tidy][NFC] Move CachedGlobList to GlobList.h 2021-12-04 08:50:49 +00:00
NoLintDirectiveHandler.cpp Re-land "Cache the locations of NOLINTBEGIN/END blocks" with fix for build bot 2022-01-27 01:03:27 +13:00
NoLintDirectiveHandler.h Re-land "Cache the locations of NOLINTBEGIN/END blocks" with fix for build bot 2022-01-27 01:03:27 +13:00
add_new_check.py [clang-tidy] Force LF newlines when writing files 2022-01-18 09:39:42 -07:00
clang-tidy-config.h.cmake Add an explicit toggle for the static analyzer in clang-tidy 2020-09-10 10:48:17 -04:00
rename_check.py Fix python 2-vs-3 issues in add_new_check.py and rename_check.py 2021-09-11 09:52:50 +02:00