summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clang-tidy/performance/UnnecessaryCopyInitialization.h
Commit message (Collapse)AuthorAgeFilesLines
* [clang-tidy] Switch checks to #include "ClangTidyCheck.h"Alexander Kornienko2019-03-251-1/+1
| | | | llvm-svn: 356892
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-4/+3
| | | | | | | | | | | | | | | | | to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636
* [clang-tidy] White List Option for performance-unnecessary-value-param, ↵Adam Balogh2018-10-121-2/+3
| | | | | | | | | | | | | | 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
* [clang-tidy] UnnecessaryCopyInitialization - Extend to trigger on non-const ↵Felix Berger2016-05-311-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | "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
* [clang-tidy] - PerformanceUnnecesaryCopyInitialization - only trigger for ↵Felix Berger2016-05-131-2/+3
| | | | | | | | | | | | | | decl stmts with single VarDecl. Summary: This fixes bug: https://llvm.org/bugs/show_bug.cgi?id=27325 Reviewers: alexfh Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D19865 llvm-svn: 269389
* Add check for unneeded copies of localsHaojian Wu2016-03-231-0/+6
| | | | | | | | | | | | | | Summary: Extends the UnnecessaryCopyInitialization to detect copies of local variables and parameters that are unneeded. Patch by Matt Kulukundis! Reviewers: alexfh, hokein Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D18149 llvm-svn: 264146
* [clang-tidy] Extend UnnecessaryCopyInitialization check to trigger on ↵Felix Berger2016-03-051-4/+4
| | | | | | | | | | | | | | | | non-const copies that can be safely converted to const references. Summary: Move code shared between UnnecessaryCopyInitialization and ForRangeCopyCheck into utilities files. Add more test cases for UnnecessaryCopyInitialization and disable fixes inside of macros. Reviewers: alexfh Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D17488 llvm-svn: 262781
* [clang-tidy] Don't use delegating constructorsAlexander Kornienko2015-12-301-1/+2
| | | | llvm-svn: 256637
* [clang-tidy] Add UnnecessaryCopyInitialization check to new "performance" ↵Alexander Kornienko2015-12-301-0/+38
module in ClangTidy Summary: The patch adds a new ClangTidy check that detects when expensive-to-copy types are unnecessarily copy initialized from a const reference that has the same or are larger scope than the copy. It currently only detects this when the copied variable is const qualified. But this will be extended to non const variables if they are only used in a const fashion. Reviewers: alexfh Subscribers: cfe-commits Patch by Felix Berger! Differential Revision: http://reviews.llvm.org/D15623 llvm-svn: 256632
OpenPOWER on IntegriCloud