summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clang-tidy/modernize/UseAutoCheck.cpp
Commit message (Collapse)AuthorAgeFilesLines
* NFC: Fix trivial typos in commentsKazuaki Ishizaki2020-01-041-1/+1
|
* Remove \brief commands from doxygen comments.Dmitri Gribenko2019-08-221-9/+9
| | | | | | | | | | | | | | | | | | | | | | | Summary: We've been running doxygen with the autobrief option for a couple of years now. This makes the \brief markers into our comments redundant. Since they are a visual distraction and we don't want to encourage more \brief markers in new code either, this patch removes them all. Patch produced by for i in $(git grep -l '\\brief'); do perl -pi -e 's/\\brief //g' $i & done [This is analogous to LLVM r331272 and CFE r331834] Subscribers: srhines, nemanjai, javed.absar, kbarton, MaskRay, jkorous, arphaman, jfb, kadircet, jsji, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D66578 llvm-svn: 369643
* 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
* A bit of AST matcher cleanup, NFC.Alexander Kornienko2018-11-251-3/+3
| | | | | | | | | Removed the uses of the allOf() matcher inside node matchers that are implicit allOf(). Replaced uses of allOf() with the explicit node matcher where it makes matchers more readable. Replace anyOf(hasName(), hasName(), ...) with the more efficient and readable hasAnyName(). llvm-svn: 347520
* [clang-tidy] This patch is a fix for D45405 where spaces were mistakenly ↵Zinovy Nis2018-06-151-2/+33
| | | | | | | | considered as a part of a type name. So length("int *") was 5 instead of 3 with RemoveStars=0 or 4 with RemoveStars=1 Differential Revision: https://reviews.llvm.org/D45927 llvm-svn: 334829
* Revert "[clang-tidy] [modernize-use-auto] Get only a length of token, not ↵Zinovy Nis2018-04-121-3/+2
| | | | | | | | | the token itself" This reverts r329873 as getting only a single token length is wrong for multi-token type names, like 'unsigned long int'. llvm-svn: 329949
* [clang-tidy] [modernize-use-auto] Get only a length of token, not the token ↵Zinovy Nis2018-04-121-2/+3
| | | | | | itself llvm-svn: 329873
* [clang-tidy] [modernize-use-auto] Fix members initialization orderZinovy Nis2018-04-101-2/+3
| | | | llvm-svn: 329740
* [clang-tidy] [modernize-use-auto] Add a threshold for minimal type name ↵Zinovy Nis2018-04-101-2/+10
| | | | | | | | | | | | length to be replaced with 'auto' The threshold option is 'MinTypeNameLength' with default value '5'. With MinTypeNameLength == 5 'int'/'bool' and 'const int'/'const bool' will not be converted to 'auto', while 'unsigned' will be. Differential Revision: https://reviews.llvm.org/D45405 llvm-svn: 329730
* Apply clang-tidy's performance-unnecessary-value-param to clang-tidy.Benjamin Kramer2017-03-211-3/+3
| | | | | | No functionality change intended. llvm-svn: 298442
* [clang-tidy] Enhance modernize-use-auto to templated function castsMalcolm Parsons2016-12-151-4/+46
| | | | | | | | | | | | | | | | Summary: Use auto when declaring variables that are initialized by calling a templated function that returns its explicit first argument. Fixes PR26763. Reviewers: aaron.ballman, alexfh, staronj, Prazek Subscribers: Eugene.Zelenko, JDevlieghere, cfe-commits Differential Revision: https://reviews.llvm.org/D27166 llvm-svn: 289797
* [clang-tools-extra] Format sources with clang-format. NFC.Mandeep Singh Grang2016-11-081-12/+11
| | | | | | | | | | | | | | | | Summary: Ran clang-format on all .c/.cpp/.h files in clang-tools-extra. Excluded the test, unittests, clang-reorder-fields, include-fixer, modularize and pptrace directories. Reviewers: klimek, alexfh Subscribers: nemanjai Tags: #clang-tools-extra Differential Revision: https://reviews.llvm.org/D26329 llvm-svn: 286221
* [clang-tidy] Enhance modernize-use-auto to castsMalcolm Parsons2016-10-311-24/+53
| | | | | | | | | | | | | | | | | | | | Summary: Extend modernize-use-auto to cases when a variable is assigned with a cast. e.g. Type *Ptr1 = dynamic_cast<Type*>(Ptr2); http://llvm.org/PR25499 Reviewers: angelgarcia, aaron.ballman, klimek, Prazek, alexfh Subscribers: Prazek, Eugene.Zelenko, cfe-commits Tags: #clang-tools-extra Differential Revision: https://reviews.llvm.org/D25316 llvm-svn: 285579
* Fix clang-tidy patterns to adapt to newly added ExprWithCleanups nodes.Tim Shen2016-06-211-0/+2
| | | | | | | | | | | | Summary: This is a fix for the new ExprWithCleanups introduced by clang's temporary variable lifetime marks change. Reviewers: bkramer, sbenza, angelgarcia, alexth Subscribers: rsmith, cfe-commits Differential Revision: http://reviews.llvm.org/D21243 llvm-svn: 273310
* [clang-tidy] modernize-use-auto: don't remove stars by defaultAlexander Kornienko2016-06-031-19/+32
| | | | | | | | | | | | | | | Summary: By default, modernize-use-auto check will retain stars when replacing an explicit type with `auto`: `MyType *t = new MyType;` will be changed to `auto *t = new MyType;`, thus resulting in more consistency with the recommendations to use `auto *` for iterating over pointers in range-based for loops: http://llvm.org/docs/CodingStandards.html#beware-unnecessary-copies-with-auto The new `RemoveStars` option allows to revert to the old behavior: with the new option turned on the check will change `MyType *t = new MyType;` to `auto t = new MyType;`. Reviewers: aaron.ballman, sbenza Subscribers: Eugene.Zelenko, cfe-commits Differential Revision: http://reviews.llvm.org/D20917 llvm-svn: 271739
* Make a bunch of static arrays const.Craig Topper2015-10-181-12/+14
| | | | llvm-svn: 250641
* Prevent modernize-use-auto from emitting a warning when 'auto' was already ↵Angel Garcia Gomez2015-10-141-0/+3
| | | | | | | | | | | | | | being used. Summary: This fixes https://llvm.org/bugs/show_bug.cgi?id=25082 . Reviewers: bkramer, klimek Subscribers: cfe-commits, alexfh Differential Revision: http://reviews.llvm.org/D13504 llvm-svn: 250284
* Refactors AST matching code to use the new AST matcher names. This patch ↵Aaron Ballman2015-09-171-14/+15
| | | | | | correlates to r247885 which performs the AST matcher rename in Clang. llvm-svn: 247886
* Fix use-auto-check.Angel Garcia Gomez2015-09-021-1/+1
| | | | | | | | | | | | Summary: Fix a bug where use-auto check would crash when the definition of a type is in the same statement than its instantiation with new. Reviewers: alexfh Subscribers: cfe-commits, klimek Differential Revision: http://reviews.llvm.org/D12551 llvm-svn: 246638
* Disable several more clang-tidy modernize checkers when not compiling in C++ ↵Aaron Ballman2015-08-281-2/+6
| | | | | | mode. Loop conversion would make recommendations for C code, so added a test to ensure that does not happen. The pass by value, use auto and replace auto_ptr checkers would not make recommendations for C code, and are disabled for performance reasons, but do not require an extra test. llvm-svn: 246310
* [clang-tidy] Migrate UseAuto from clang-modernize to clang-tidy.Angel Garcia Gomez2015-08-211-0/+368
http://reviews.llvm.org/D12231 llvm-svn: 245703
OpenPOWER on IntegriCloud