summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clang-tidy
Commit message (Collapse)AuthorAgeFilesLines
...
* [clang-tidy] Fix llvm-include-order check on Windows.Alexander Kornienko2015-09-041-1/+1
| | | | | | | | | | | IncludeDirectives struct used a StringRef that pointed to a stack variable (SmallString<128> FilenameBuffer from PPDirectives.cpp:1513). http://reviews.llvm.org/D12632 Patch by Marek Kurdej! llvm-svn: 246856
* [clang-tidy] Fix add_new_check.py.Alexander Kornienko2015-09-041-2/+3
| | | | | | | | | | | | This fixes the case where the check should be added at the end of the list of checks in CMakeLists.txt of the corresponding module. Before it was added after LINK_LIBS line. http://reviews.llvm.org/D12629 Patch by Marek Kurdej! llvm-svn: 246854
* Two more fixes to loop convert.Angel Garcia Gomez2015-09-032-2/+49
| | | | | | | | | | | | Summary: Ensure that the alias has the same type than the loop variable. Now it works with lambda captures. Reviewers: klimek Subscribers: alexfh, cfe-commits Differential Revision: http://reviews.llvm.org/D12597 llvm-svn: 246762
* Disable clang-tidy Google checkers when not compiling in C++ mode. None of ↵Aaron Ballman2015-09-027-11/+32
| | | | | | the checkers require additional testing as the tests will not compile for other languages or modes, or the checkers would never match a valid construct. llvm-svn: 246663
* Disable clang-tidy readability checkers when not compiling in C++ mode. None ↵Aaron Ballman2015-09-024-1/+19
| | | | | | of the checkers require additional testing as the tests will not compile for other languages or modes, or the checkers would never match a valid construct. llvm-svn: 246661
* Fix loop-convert crash.Angel Garcia Gomez2015-09-021-1/+4
| | | | | | | | | | | | Summary: loop-convert no longer crashes when calling a member function using a member pointer which is a member of another record. Reviewers: alexfh, klimek Subscribers: cfe-commits, klimek Differential Revision: http://reviews.llvm.org/D12555 llvm-svn: 246655
* 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
* Add \n to the regex in clang-tidy-diff.py in order to fix ↵Yaron Keren2015-09-011-1/+1
| | | | | | | | http://llvm.org/PR24637, git usecase for multiple files diff. llvm-svn: 246575
* Fix several corner cases for loop-convert check.Angel Garcia Gomez2015-09-013-17/+48
| | | | | | | | | | | | Summary: Reduced the amount of wrong conversions of this check. Reviewers: klimek Subscribers: alexfh, cfe-commits Differential Revision: http://reviews.llvm.org/D12530 llvm-svn: 246550
* Allow the static assert clang-tidy checker to run over C code.Aaron Ballman2015-08-311-4/+3
| | | | llvm-svn: 246495
* Using an early return as it is more clear; NFC.Aaron Ballman2015-08-319-150/+158
| | | | llvm-svn: 246447
* [clang-tidy] misc-assert-side-effect: support assert macros defined through ↵Alexander Kornienko2015-08-311-14/+18
| | | | | | other macros llvm-svn: 246446
* Using an early return as it is more clear; NFC.Aaron Ballman2015-08-311-24/+24
| | | | llvm-svn: 246444
* [clang-tidy] Move misc-use-override and readability-shrink-to-fit to ↵Alexander Kornienko2015-08-3110-21/+20
| | | | | | | | | "modernize/" These checks are focusing on migrating the code from C++98/03 to C++11, so they belong to the modernize module. llvm-svn: 246437
* Updated to make use of the AST matcher instead of a custom matcher; NFC.Aaron Ballman2015-08-281-4/+0
| | | | llvm-svn: 246325
* Disable clang-tidy misc checkers when not compiling in C++ mode. Many of the ↵Aaron Ballman2015-08-2811-146/+200
| | | | | | checkers do not require additional testing as the tests will not compile for other languages or modes, or the checkers would never match a valid construct. llvm-svn: 246318
* Disable several more clang-tidy modernize checkers when not compiling in C++ ↵Aaron Ballman2015-08-284-37/+66
| | | | | | 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
* Reapplying r246209, which exposed language options to the checkers. This ↵Aaron Ballman2015-08-284-1/+13
| | | | | | time disable UseNullptrCheck when not compiling in C++ mode, but still allow in C++11 mode since it's likely the user wishes to modernize their code. llvm-svn: 246298
* Reverting r246209 while I investigate a build bot failure: ↵Aaron Ballman2015-08-274-11/+1
| | | | | | http://lab.llvm.org:8011/builders/clang-x86_64-debian-fast/builds/30516 llvm-svn: 246224
* Expose language options to the checkers; disable UseNullptrCheck when not ↵Aaron Ballman2015-08-274-1/+11
| | | | | | compiling in C++11 mode. llvm-svn: 246209
* [clang-tidy] Update docs for clang-tidy checks. NFCAlexander Kornienko2015-08-2743-168/+249
| | | | | | | | | | | Changes mostly address formatting and unification of the style. Use MarkDown style for inline code snippets and lists. Added some text for a few checks. The idea is to move most of the documentation out to separate rST files and have implementation files refer to the corresponding documentation files. llvm-svn: 246169
* Fix another LoopConvert fail.Angel Garcia Gomez2015-08-261-2/+8
| | | | | | | | | | | | Summary: Prevent LoopConvert from taking as alias anything that comes from a random member function call. Reviewers: alexfh Subscribers: klimek, cfe-commits Differential Revision: http://reviews.llvm.org/D12370 llvm-svn: 246039
* LoopConvert no longer take as alias references to other containers.Angel Garcia Gomez2015-08-261-1/+1
| | | | | | | | | | | | Summary: Fix a bug where modernize-loop-convert check would take as alias a reference to other containers. Add the pertinent test. Reviewers: alexfh Subscribers: klimek, cfe-commits Differential Revision: http://reviews.llvm.org/D12361 llvm-svn: 246034
* Avoid LoopConvertCheck replacements in template instantiations.Angel Garcia Gomez2015-08-251-0/+3
| | | | | | | | | | | | Summary: Prevent LoopConvertCheck from doing replacements in template instantiations, and add a test. Reviewers: alexfh Subscribers: klimek, cfe-commits Differential Revision: http://reviews.llvm.org/D12321 llvm-svn: 245942
* Add replace-auto_ptr check.Angel Garcia Gomez2015-08-254-0/+326
| | | | | | | | | | | | Summary: Migrate replace-auto_ptr check from clang-modernize to modernize module in clang-tidy. Reviewers: alexfh Subscribers: klimek, cfe-commits Differential Revision: http://reviews.llvm.org/D12287 llvm-svn: 245933
* Tests no longer need the 'REQUIRES: SHELL' line.Angel Garcia Gomez2015-08-251-1/+0
| | | | | | | | | | | | Summary: Update python script, so that it doesn't print that line in new tests. Reviewers: alexfh Subscribers: klimek, cfe-commits Differential Revision: http://reviews.llvm.org/D12281 llvm-svn: 245926
* [clang-tidy] Migrate UseAuto from clang-modernize to clang-tidy.Angel Garcia Gomez2015-08-214-0/+407
| | | | | | http://reviews.llvm.org/D12231 llvm-svn: 245703
* Test commit!Angel Garcia Gomez2015-08-211-0/+1
| | | | llvm-svn: 245701
* Tweak clang-tidy-diff.py to recognize "filename" in the diff ourput.Yaron Keren2015-08-211-1/+1
| | | | llvm-svn: 245683
* [clang-tidy] Use check_clang_tidy.py instead of check_clang_tidy.sh by default.Alexander Kornienko2015-08-201-1/+1
| | | | llvm-svn: 245586
* Add a new clang-tidy check (misc-move-constructor-init) that diagnoses move ↵Aaron Ballman2015-08-204-0/+113
| | | | | | constructor initializations that call copy constructors instead of move constructors. llvm-svn: 245571
* Tweak clang-tidy-diff.py to pass JSON argument correctly to clang-tidy on ↵NAKAMURA Takumi2015-08-201-2/+8
| | | | | | | | | | | win32 arg parser. - Single quotation is not recognized. - Use """ to pass a double quotation. It also reverts r211831. llvm-svn: 245567
* [clang-tidy] Fix bug in modernize-loop-convert check.Alexander Kornienko2015-08-201-2/+3
| | | | | | | | http://reviews.llvm.org/D12186 Patch by Angel Garcia! llvm-svn: 245561
* [clang-tidy] Fold the meat of the UseNullPtrCheck into an anonymous namespace.Benjamin Kramer2015-08-201-0/+2
| | | | | | | | While convenient, RecursiveASTVisitor generates a ridiculous amount of dead template code. Making it not visible from the outside lets the compiler eliminate some of it, shrinking clang-tidy by ~140k. llvm-svn: 245548
* [clang-tidy] Add back a test with a custom NULL macro. Remove redundant default.Alexander Kornienko2015-08-201-1/+1
| | | | llvm-svn: 245533
* [clang-tidy] Fix use-after-free in UseNullptrCheck.Alexander Kornienko2015-08-192-6/+5
| | | | llvm-svn: 245524
* [clang-tidy] Work around failure in Darwin.Alexander Kornienko2015-08-191-1/+1
| | | | llvm-svn: 245517
* [clang-tidy] Add modernize-use-nullptr check, attempt 2.Alexander Kornienko2015-08-194-0/+511
| | | | | | | | | | | This patch re-applies r245434 and r245471 reverted in r245493, and changes the way custom null macros are configured. The test for custom null macros is temporarily excluded and will be committed separately to reduce chances of breakages. Initial patches by Angel Garcia. llvm-svn: 245511
* Fix IncludeInserter to allow for more than one added header per file.Daniel Jasper2015-08-191-3/+2
| | | | | | | | Also adapt tests a bit to make it possible to test this. Removed checking the number of errors reported per test. It was never actually checked and doesn't seem particularly relevant to the test itself. llvm-svn: 245500
* Revert "[clang-tidy] Add use-nullptr check to clang-tidy."Justin Bogner2015-08-194-512/+0
| | | | | | | | | | The new test is failing on darwin: http://lab.llvm.org:8080/green/job/clang-stage1-configure-RA_check/10339/ This reverts r245434 and its follow up r245471. llvm-svn: 245493
* Replacing a custom AST matcher with some builtin AST matchers; NFC, and ↵Aaron Ballman2015-08-191-14/+1
| | | | | | existing tests should provide sufficient coverage. llvm-svn: 245492
* [clang-tidy] Fix a bug in UseNullptrCheck.Alexander Kornienko2015-08-191-3/+3
| | | | | | | | http://reviews.llvm.org/D12162 Patch by Angel Garcia! llvm-svn: 245471
* [clang-tidy] Fix LoopConvertCheck bug.Alexander Kornienko2015-08-192-11/+14
| | | | | | | | | | | | Fix LoopConvertCheck bug: StringRef to temporaries. Also add LLVM_ATTRIBUTE_UNUSED to ModernizeModuleAnchorDestination. http://reviews.llvm.org/D12157 Patch by Angel Garcia! llvm-svn: 245458
* [clang-tidy] Add use-nullptr check to clang-tidy.Alexander Kornienko2015-08-194-0/+512
| | | | | | | | | | Move UseNullptr from clang-modernize to modernize module in clang-tidy. http://reviews.llvm.org/D12081 Patch by Angel Garcia! llvm-svn: 245434
* [clang-tidy] Add new IdentifierNaming checkAlexander Kornienko2015-08-194-0/+664
| | | | | | | | | | | | | | | | | | | | This check will try to enforce coding guidelines on the identifiers naming. It supports lower_case, UPPER_CASE, camelBack and CamelCase casing and tries to convert from one to another if a mismatch is detected. It also supports a fixed prefix and suffix that will be prepended or appended to the identifiers, regardless of the casing. Many configuration options are available, in order to be able to create different rules for different kind of identifier. In general, the rules are falling back to a more generic rule if the specific case is not configured. http://reviews.llvm.org/D10933 Patch by Beren Minor! llvm-svn: 245429
* [clang-tidy] Add loop-convert check to clang-tidy.Alexander Kornienko2015-08-196-0/+1962
| | | | | | | | | | Move LoopConvert from clang-modernize to modernize module in clang-tidy. http://reviews.llvm.org/D12076 Patch by Angel Garcia! llvm-svn: 245427
* Insert override at the same line as the end of the function declarationEhsan Akhgari2015-08-191-2/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The existing check converts the code pattern below: void f() { } to: void f() override { } which is fairly sub-optimal. This patch fixes this by inserting the override keyword on the same line as the function declaration if possible, so that we instead get: void f() override { } We do this by looking for the last token before the start of the body and inserting the override keyword at the end of its location. Note that we handle const, volatile and ref-qualifiers correctly. Test Plan: Includes an automated test. Reviewers: alexfh Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D9286 llvm-svn: 245401
* We no longer need a custom matcher for this; use the builtin AST matcher ↵Aaron Ballman2015-08-181-8/+2
| | | | | | instead. NFC, and existing tests should cover this change. llvm-svn: 245340
* [clang-tidy] Fixed typos and formatting in a comment. NFCAlexander Kornienko2015-08-181-5/+5
| | | | llvm-svn: 245310
* [clang-tidy] Fix a use-after-free.Alexander Kornienko2015-08-171-1/+1
| | | | llvm-svn: 245215
OpenPOWER on IntegriCloud