summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clang-tidy
Commit message (Collapse)AuthorAgeFilesLines
...
* [clang-tidy] Allow use of -list-checks option without need to pass source files.Alexander Kornienko2015-08-171-6/+17
| | | | | | | | | | | | Initialize CommonOptionsParser with ZeroOrOne NumOccurrenceFlag so callers can pass -list-checks without the need to pass additional positional parameters, then add dummy file if none were supplied. http://reviews.llvm.org/D12070 Patch by Don Hinton! llvm-svn: 245205
* clangTidyModernizeModule: Update libdeps.NAKAMURA Takumi2015-08-151-0/+1
| | | | llvm-svn: 245144
* [clang-tidy] Move IncludeSorter.* and IncludeInserter.* to clang-tidy/utils/Alexander Kornienko2015-08-147-4/+4
| | | | | | | This is better structurally and it also fixes a linker error in the configure build. llvm-svn: 245052
* misc-unused-parameters: Fix crasher with C forward declarations thatDaniel Jasper2015-08-141-1/+2
| | | | | | can leave out the parameter list. llvm-svn: 245048
* [clang-tidy] Create clang-tidy module modernize. Add pass-by-value check.Alexander Kornienko2015-08-1410-4/+344
| | | | | | | | | | This is the first step for migrating cppmodernize to clang-tidy. http://reviews.llvm.org/D11946 Patch by Angel Garcia! llvm-svn: 245045
* [clang-tidy] Fix IncludeInserter/IncludeSorter bug.Alexander Kornienko2015-08-143-32/+56
| | | | | | | | | | | If there weren't any includes in the file, or all of them had 'IncludeKind' greater than the desired one, then 'CreateIncludeInsertion' didn't work. http://reviews.llvm.org/D12017 Patch by Angel Garcia! llvm-svn: 245042
* [clang-tidy] Make FileOptionsProvider fields protected to make extending it ↵Alexander Kornienko2015-08-121-1/+1
| | | | | | easier llvm-svn: 244793
* Lazily initialize HeaderFilter in ClangTidyDiagnosticConsumer. ThisDaniel Jasper2015-08-122-14/+12
| | | | | | | | | removes a corner case in tests that don't set the diagnostic consumer. In tests, it is good, not to set the diagnostic consumer so that Clang's parsing diagnostics are still displayed in the test output and only ClangTidy's output is analyzed differently. llvm-svn: 244745
* Fix strict dependency uncovered by windows bot.Manuel Klimek2015-08-111-0/+1
| | | | llvm-svn: 244598
* Fix shadowing of type with variable.Manuel Klimek2015-08-111-4/+4
| | | | llvm-svn: 244587
* Add an IncludeInserter to clang-tidy.Manuel Klimek2015-08-115-0/+508
| | | | | | Will be used to allow checks to insert includes at the right position. llvm-svn: 244586
* misc-unused-parameters: Don't touch K&R style functions.Daniel Jasper2015-08-101-1/+2
| | | | | | We couldn't calculate the removal ranges properly at this point. llvm-svn: 244454
* Silence gcc 5.1 unused variable warnings using LLVM_ATTRIBUTE_UNUSED.Yaron Keren2015-08-071-4/+4
| | | | llvm-svn: 244329
* [clang-tidy] Improve the misc-unused-alias-decl messageAlexander Kornienko2015-08-032-3/+4
| | | | | | "this namespace alias decl is unused" -> "namespace alias decl '...' is unused" llvm-svn: 243906
* Replace callback-if with isExpansionInMainFile as suggested in postDaniel Jasper2015-08-031-6/+4
| | | | | | commit review. llvm-svn: 243871
* Add missing 'override'.Daniel Jasper2015-07-311-1/+1
| | | | llvm-svn: 243773
* Add misc-unused-alias-decls check that currently finds unused namespaceDaniel Jasper2015-07-314-0/+102
| | | | | | | alias declarations. In the future, we might want to reuse it to also fine unsed using declarations and such. llvm-svn: 243754
* [clang-tidy] Support replacements in macro arguments in ↵Alexander Kornienko2015-07-311-11/+34
| | | | | | | | | | | | | | | | misc-inefficient-algorithm Summary: Support replacements in macro arguments in the misc-inefficient-algorithm check. Reviewers: klimek Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D11677 llvm-svn: 243747
* misc-unused-parameters: Only remove parameters in the main source file.Daniel Jasper2015-07-281-1/+3
| | | | | | | In headers, they might always be pulled in to different TUs, even if they are declared static or nested in an unnamed namespace. llvm-svn: 243414
* misc-unused-parameters: Properly handle static class members.Daniel Jasper2015-07-281-3/+4
| | | | | | Not sure why I wrote what I wrote before. llvm-svn: 243403
* misc-unused-parameters: Don't warn on ParmVarDecls in the return type.Daniel Jasper2015-07-272-16/+23
| | | | | | | | | As there don't seem to be a good way of formulating a matcher that finds all pairs of functions and their ParmVarDecls, just match on functionDecls and iterate over their parameters. This should also be more efficient as some checks are only performed once per function. llvm-svn: 243267
* Updating the documentation for clang-tidy. Removes some non-ASCII characters ↵Aaron Ballman2015-07-271-2/+2
| | | | | | from the documentation, and removes shell-specific single quote characters as they cause issues for some shells (such as on Windows). llvm-svn: 243266
* [clang-tidy] Don't duplicate the leading slash.Alexander Kornienko2015-07-271-1/+1
| | | | llvm-svn: 243265
* misc-unused-parameters: Fix bug where the check was looking atDaniel Jasper2015-07-231-2/+4
| | | | | | ParmVarDecls of function types. llvm-svn: 243026
* misc-unused-parameters: Fix handling of parameters in template functions.Daniel Jasper2015-07-221-2/+2
| | | | | | | | | | | | | The parameters of the function templates were being marked as incorrectly be marked as unused. Added a test for this and changed the check to use the same isReferenced() || !getDeclName() logic as Sema::DiagnoseUnusedParameters. Patch Scott Wallace, thank you! llvm-svn: 242912
* Extend misc-unused-parameters to delete parameters of local functions.Daniel Jasper2015-07-201-3/+65
| | | | | | Also see: llvm.org/PR24180. llvm-svn: 242659
* Initial version of clang-tidy check to find and fix unused parameters.Daniel Jasper2015-07-204-0/+79
| | | | | | Also see: llvm.org/PR24180. llvm-svn: 242654
* [clang-tidy] Enhance clang-tidy misc-macro-repeated-side-effects...Daniel Marjamaki2015-07-021-18/+50
| | | | | | | | | | | Enhance clang-tidy misc-macro-repeated-side-effects to handle ? and : better. When ? is used in a macro, there are 2 possible control flow paths through the macro. These paths are tracked separately so problems can be detected properly. http://reviews.llvm.org/D10653 llvm-svn: 241245
* [clang-tidy] minor coding style tweak. make functions static.Daniel Marjamaki2015-07-011-5/+5
| | | | llvm-svn: 241160
* [clang-tidy] Enhance clang-tidy readability-simplify-boolean-expr...Alexander Kornienko2015-07-012-29/+276
| | | | | | | | | | | | | | | | | | | | Enhance clang-tidy readability-simplify-boolean-expr to handle 'if (e) return true; return false;' and improve replacement expressions. This changeset extends the simplify boolean expression check in clang-tidy to simplify if (e) return true; return false; to return e; (note the lack of an else clause on the if statement.) By default, chained conditional assignment is left unchanged, unless a configuration parameter is set to non-zero to override this behavior. It also improves the handling of replacement expressions to apply static_cast<bool>(expr) when expr is not of type bool. http://reviews.llvm.org/D9810 Patch by Richard Thomson! llvm-svn: 241155
* [clang-tidy] Fix false positives in the macro parentheses checkerDaniel Marjamaki2015-06-291-2/+11
| | | | | | | | | | | Summary: There were false positives in C++ code where macro argument was a type. Reviewers: alexfh Differential Revision: http://reviews.llvm.org/D10801 llvm-svn: 240938
* [clang-tidy] Fix false positives in misc-macro-parentheses checkerDaniel Marjamaki2015-06-231-3/+3
| | | | llvm-svn: 240399
* clang-tidy: Remove an unused private field. NFCJustin Bogner2015-06-181-5/+3
| | | | | | Clang was warning on this. llvm-svn: 239988
* clang-tidy: Add checker that warn when macro argument with side effects is ↵Daniel Marjamaki2015-06-174-0/+179
| | | | | | repeated in the macro llvm-svn: 239909
* [clang-tidy] Move user-defined matches to unnamed namespaces to prevent ODR ↵Alexander Kornienko2015-06-178-29/+25
| | | | | | violations. llvm-svn: 239904
* clang-tidy: Add checker that warns about missing parentheses in macrosDaniel Marjamaki2015-06-164-0/+238
| | | | | | | * calculations in the replacement list should be inside parentheses * macro arguments should be inside parentheses llvm-svn: 239820
* [clang-tidy] Force braces around leaf 'else if' for consistency.Samuel Benzaquen2015-06-042-5/+14
| | | | | | | | | | | | | | Summary: Force braces around leaf 'else if' for consistency. This complements r233697. Reviewers: alexfh Subscribers: curdeius, cfe-commits Differential Revision: http://reviews.llvm.org/D10245 llvm-svn: 239054
* [clang-tidy] Fix for llvm.org/PR23355Szabolcs Sipos2015-05-292-6/+13
| | | | | | misc-static-assert and misc-assert-side-effect will handle __builtin_expect based asserts correctly. llvm-svn: 238548
* [clang-tidy] Renamed misc-noexcept-move-ctors to misc-noexcept-move-constructorAlexander Kornienko2015-05-274-14/+15
| | | | llvm-svn: 238326
* [clang-tidy] misc-noexcept-move-ctors should ignore implicit constructors ↵Alexander Kornienko2015-05-262-4/+5
| | | | | | and assignments. llvm-svn: 238202
* [clang-tidy] Don't issue most google-readability-casting warnings on .c ↵Alexander Kornienko2015-05-261-8/+11
| | | | | | | | | files included in other files. This is done sometimes for testing purposes, and the check needs to handle this consistently. llvm-svn: 238193
* [clang-tidy] Fix for llvm.org/PR23572Szabolcs Sipos2015-05-231-1/+3
| | | | | | misc-static-assert won't report asserts whose conditions contain calls to non constexpr functions. llvm-svn: 238098
* Add a clang-tidy check for move constructors/assignment ops without noexcept.Alexander Kornienko2015-05-224-0/+106
| | | | | | | | | | | | | | | | | | Summary: Add a clang-tidy check (misc-noexcept-move-ctors) for move constructors and assignment operators not using noexcept. http://llvm.org/PR23519 Reviewers: klimek Reviewed By: klimek Subscribers: curdeius, cfe-commits Differential Revision: http://reviews.llvm.org/D9933 llvm-svn: 238013
* [clang-tidy] Disable google-readability-casting for .c files and their headers.Alexander Kornienko2015-05-213-0/+10
| | | | | | | | | Some people have reasons to compile their .c files as C++ in some configurations (e.g. for testing purposes), so just looking at LangOptions is not enough. This patch disables the check on all .c files (and also for the headers included from .c files). llvm-svn: 237905
* [clang-tidy] Enhance clang-tidy readability-simplify-boolean-expr check...Alexander Kornienko2015-05-172-16/+55
| | | | | | | | | | | | | | | | Enhance clang-tidy readability-simplify-boolean-expr check to handle chained conditional assignment and chained conditional return. Based on feedback from applying this tool to the clang/LLVM codebase, this changeset improves the readability-simplify-boolean-expr check so that conditional assignment or return statements at the end of a chain of if/else if statements are left unchanged unless a configuration option is supplied. http://reviews.llvm.org/D8996 Patch by Richard Thomson! llvm-svn: 237541
* [clang-tidy] Treat all types with non-trivial destructors as RAII.Alexander Kornienko2015-05-121-3/+3
| | | | | | | This solves some false negatives at a cost of adding some false positives that can be fixed easily and (almost) automatically. llvm-svn: 237120
* [clang-tidy] Fix for llvm.org/PR23161Szabolcs Sipos2015-05-081-1/+1
| | | | | | | | | | The misc-static-assert check will not warn on the followings: assert(NULL == "shouldn't warn"); assert(__null == "shouldn't warn"); Where NULL is a macro defined as __null. llvm-svn: 236812
* Update to match clang r236404.Richard Smith2015-05-041-4/+4
| | | | llvm-svn: 236405
* clang-tidy: [readability-else-after-return] Fix false positive. ThisDaniel Jasper2015-04-271-3/+5
| | | | | | | might be a little too strict now, but better be too strict than do the wrong thing. llvm-svn: 235932
* [clang-tidy] Remove static StringSet in favor of binary search.Benjamin Kramer2015-04-172-37/+29
| | | | | | | | The number of strings is so small that performance doesn't matter and adding the thread safe static initialization and destruction overhead is just not worth it. No functional change intended. llvm-svn: 235192
OpenPOWER on IntegriCloud