summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clang-tidy
Commit message (Collapse)AuthorAgeFilesLines
...
* [clang-tidy] ClangTidy check to flag uninitialized builtin and pointer fields.Felix Berger2016-02-154-0/+278
| | | | | | | | | | | | | | | | | | | | | Summary: This patch is a continuation of http://reviews.llvm.org/D10553 by Jonathan B Coe. The main additions are: 1. For C++11 the check suggests in-class field initialization as fix. This makes the fields future proof towards the addition of new constructors. 2 For older language versions the fields are added in the right position in the initializer list with more tests. 3. User documentation. Reviewers: alexfh, jbcoe Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D16517 llvm-svn: 260873
* [clang-tidy] Only invoke ForRangeCopyCheck on expensive-to-copy types.Felix Berger2016-02-151-3/+6
| | | | | | | | | | | | | | Summary: Fix oversight not checking the value of the Optional<bool> returned by isExpensiveToCopy(). Reviewers: alexfh Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D17064 llvm-svn: 260870
* [clang-tidy] Add check performance-faster-string-findSamuel Benzaquen2016-02-124-0/+175
| | | | | | | | | | | | | | Summary: Add check performance-faster-string-find. It replaces single character string literals to character literals in calls to string::find and friends. Reviewers: alexfh Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D16152 llvm-svn: 260712
* Reapply r260096.Aaron Ballman2016-02-122-162/+140
| | | | | | | | | | | | Expand the simplify boolean expression check to handle implicit conversion of integral types to bool and improve the handling of implicit conversion of member pointers to bool. Implicit conversion of member pointers are replaced with explicit comparisons to nullptr. Implicit conversions of integral types are replaced with explicit comparisons to 0. Patch by Richard Thomson. llvm-svn: 260681
* [clang-tidy] Fix failure in 'misc-misplaced-widening-cast' test.Daniel Marjamaki2016-02-121-4/+9
| | | | | | | | I added portability warnings when int results are casted to long. I forgot to handle uint, ulong and ulonglong. Tested on x86 and powerpc targets, hope it works now on all buildbots. llvm-svn: 260667
* [clang-tidy] improve misc-misplaced-widening-cast so it also detects ↵Daniel Marjamaki2016-02-121-3/+22
| | | | | | | | | | | | portability problems. Reviewers: alexfh Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D17140 llvm-svn: 260665
* [clang-tidy] google-runtime-int: fix a false positive in implicit code.Alexander Kornienko2016-02-112-3/+41
| | | | llvm-svn: 260535
* Merge branch 'arcpatch-D16922'Cong Liu2016-02-112-8/+15
| | | | llvm-svn: 260532
* [clang-tidy] Fix an assert failure in 'readability-braces-around-statements' ↵Haojian Wu2016-02-111-1/+4
| | | | | | | | | | | | | | | | | | check. Summary: The check will trigger a assert failure("CondEndLoc.isValid") when checking the IfStmt whose condition expression is not parsed. In this case, we should ignore that. Reviewers: alexfh Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D17069 llvm-svn: 260505
* [clang-tidy] Add a check to find unintended semicolons that changes the ↵Gabor Horvath2016-02-114-0/+114
| | | | | | | | | | semantics. Reviewers: hokein, alexfh Differential Revision: http://reviews.llvm.org/D16535 llvm-svn: 260503
* [clang-tidy] Add 'misc-misplaced-widening-cast' check.Daniel Marjamaki2016-02-094-0/+148
| | | | | | | | | | Reviewers: alexfh Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D16310 llvm-svn: 260223
* [clang-tidy] Make readability-container-size-empty work with inline ↵Gabor Horvath2016-02-091-18/+21
| | | | | | namespaces. Fix PR25812. llvm-svn: 260217
* [clang-tidy] Replace a custom ASTMatcher with a built-in one.Gabor Horvath2016-02-091-4/+2
| | | | llvm-svn: 260212
* [clang-tidy] Some improvements in 'misc-definitions-in-headers' check.Haojian Wu2016-02-081-0/+4
| | | | | | | | | | Reviewers: alexfh Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D16979 llvm-svn: 260108
* [clang-tidy] Fix assertion failure on `at` function in modernize-loop-convert.Haojian Wu2016-02-081-2/+2
| | | | | | | | | | Reviewers: alexfh Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D16926 llvm-svn: 260107
* [clang-tidy] Correct IncorrectRoundings namespace.Haojian Wu2016-02-082-1/+4
| | | | | | | | | | Reviewers: alexfh Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D16987 llvm-svn: 260105
* Reverting r260096; it causes build bot failures:Aaron Ballman2016-02-082-138/+162
| | | | | | | http://bb.pgr.jp/builders/cmake-clang-tools-x86_64-linux/builds/23351 http://lab.llvm.org:8011/builders/clang-s390x-linux/builds/492 llvm-svn: 260097
* Expand the simplify boolean expression check to handle implicit conversion ↵Aaron Ballman2016-02-082-162/+138
| | | | | | | | | | | | of integral types to bool and improve the handling of implicit conversion of member pointers to bool. Implicit conversion of member pointers are replaced with explicit comparisons to nullptr. Implicit conversions of integral types are replaced with explicit comparisons to 0. Patch by Richard Thomson. llvm-svn: 260096
* [clang-tidy] Move incorrect-roundings to upstream.Haojian Wu2016-02-084-1/+117
| | | | | | | | | | | | Summary: This is originally implemented by Jacques Pienaar. Reviewers: alexfh Subscribers: cfe-commits, jpienaar Differential Revision: http://reviews.llvm.org/D16764 llvm-svn: 260084
* [clang-tidy] Reformatted docs + minor updatesAlexander Kornienko2016-02-081-115/+138
| | | | llvm-svn: 260065
* Unbreak the cmake shared build.Benjamin Kramer2016-02-051-0/+1
| | | | llvm-svn: 259880
* [clang-tdiy] Add header file extension configuration support.Haojian Wu2016-02-0511-41/+252
| | | | | | | | | | | | Summary: * Add a `HeaderFileExtensions` check option in misc-definitions-in-headers, google-build-namespaces and google-global-names-in-headers. Reviewers: aaron.ballman, alexfh Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D16113 llvm-svn: 259879
* [clang-tidy] More friendly warning in "google-runtime-references" when ↵Haojian Wu2016-02-041-3/+10
| | | | | | | | | | | | meeting an unnamed function parameter. Reviewers: alexfh Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D16882 llvm-svn: 259787
* [clang-tidy] Fix a crash issue on misc-virtual-near-miss check.Haojian Wu2016-02-031-0/+3
| | | | | | | | | | | | | | Summary: The crash is caused by triggering a Assertion failed in DeclCXX.h when the check detects non-defined class return type in a class method declaration. Reviewers: congliu, alexfh Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D16854 llvm-svn: 259668
* [clang-tidy] bug fix: Don't warn on partial template specialization in ↵Haojian Wu2016-02-031-1/+4
| | | | | | | | | | | | `misc-definitions-in-headers` check. Reviewers: alexfh Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D16578 llvm-svn: 259643
* clang-tidy: [misc-unused-parameters] Ignore template instantiations.Daniel Jasper2016-02-031-1/+2
| | | | | | | | | No functional changes intended as we should already do the corresponding fixes when visiting the primary template. There are existing tests that verify that we do change unused parameters of templated functions. llvm-svn: 259640
* [clang-tidy] Add non-constant references in function parameters check.Alexander Kornienko2016-02-024-0/+159
| | | | | | | | | | | | | | | Summary: This is implemented originally by Alexander Kornienko. Reviewers: alexfh Subscribers: cfe-commits Patch by Haojian Wu! Differential Revision: http://reviews.llvm.org/D16717 llvm-svn: 259530
* Sort checks alphabetically in ReadabilityTidyModule.cpp.Eugene Zelenko2016-02-011-4/+4
| | | | llvm-svn: 259393
* Add a new check, readability-redundant-control-flow, that check for some ↵Aaron Ballman2016-02-014-0/+154
| | | | | | | | forms of redundant control flow statements. Currently checks for return statements at the end of a function with a void return type and continue statements at the end of looping statements. Patch by Richard Thomson. llvm-svn: 259362
* [clang-tidy] Don't use delegating constructors, since they are not supported ↵Alexander Kornienko2016-01-291-3/+4
| | | | | | by MSVC 2013 llvm-svn: 259214
* [clang-tidy] ForRangeCopyCheck that warns on and fixes unnecessary copies of ↵Alexander Kornienko2016-01-295-5/+243
| | | | | | | | | | loop variables. Patch by Felix Berger! Differential revision: http://reviews.llvm.org/D13849 llvm-svn: 259199
* [clang-tidy] Fix minor style issues. NFCAlexander Kornienko2016-01-292-9/+8
| | | | llvm-svn: 259198
* Fixed function params comparison. Updated docs and tests.Alexander Kornienko2016-01-292-38/+40
| | | | | | | | | | | | | | Summary: "checkParamTypes" may fail if the the type of some parameter is not canonical. Fixed it by comparing canonical types. And added "getCanonicalType()" and "getCanonicalDecl()" on more places to prevent potential fail. Reviewers: alexfh Subscribers: cfe-commits Patch by Cong Liu! Differential Revision: http://reviews.llvm.org/D16587 llvm-svn: 259197
* [clang-tidy] Fix style issues. NFCAlexander Kornienko2016-01-291-10/+6
| | | | llvm-svn: 259196
* [clang-tidy] Move implicit-cast-in-loop check to upstream.Alexander Kornienko2016-01-294-0/+147
| | | | | | | | | | | | | | Summary: This is implemented originally by Alex Pilkiewicz (pilki@google.com). Reviewers: alexfh Subscribers: cfe-commits Patch by Haojian Wu! Differential Revision: http://reviews.llvm.org/D16721 llvm-svn: 259195
* Remove autoconf supportChris Bieneman2016-01-2611-173/+0
| | | | | | | | | | | | | | | | Summary: This patch is provided in preparation for removing autoconf on 1/26. The proposal to remove autoconf on 1/26 was discussed on the llvm-dev thread here: http://lists.llvm.org/pipermail/llvm-dev/2016-January/093875.html "Now I am become Death, the destroyer of worlds." -J. Robert Oppenheimer Reviewers: chandlerc, grosbach, bob.wilson, echristo Subscribers: cfe-commits, klimek Differential Revision: http://reviews.llvm.org/D16475 llvm-svn: 258864
* Test commit. Fix typo in comment.Jonathan Coe2016-01-261-1/+1
| | | | llvm-svn: 258835
* Fix crashing on user-defined conversion.Alexander Kornienko2016-01-261-3/+5
| | | | | | | | | | | | | | Summary: Fix the assertion failure for the user-defined conversion method. e.g.: operator bool() Reviewers: alexfh, aaron.ballman Subscribers: aaron.ballman, cfe-commits Patch by Cong Liu! Differential Revision: http://reviews.llvm.org/D16536 llvm-svn: 258801
* Add support to the misc-assert-side-effect check for MSVC-style assert ↵Aaron Ballman2016-01-251-4/+11
| | | | | | macros, which use !! instead of an if statement or a conditional operator. llvm-svn: 258714
* [clang-tidy] Handle decayed types and other improvements in VirtualNearMiss ↵Gabor Horvath2016-01-222-36/+31
| | | | | | | | | | | check. Handle decayed types, ignore qualifiers and accessibility when considering a method as a possible overload. Differential Revision: http://reviews.llvm.org/D16179 llvm-svn: 258562
* Make modernize-use-default tolerant of delayed template parsing; this code ↵Aaron Ballman2016-01-201-0/+1
| | | | | | was previously causing failed assertions because dyn_cast was being passed a null pointer due to the delay-parsed body. llvm-svn: 258356
* [clang-tidy] Python scripts shebang fixesAlexander Kornienko2016-01-191-1/+1
| | | | | | | | | | | | | | | | | | | Summary: This patch fixes shebang lines in Python script files. Most Python scripts in LLVM & Clang are using this shebang line. [[ https://mail.python.org/pipermail/tutor/2007-June/054816.html | Here]] is an explanaiton of why such line should be used instead of what is currently in these few files. Reviewers: klimek, alexfh Subscribers: cfe-commits Patch by Kirill Bobyrev! Differential Revision: http://reviews.llvm.org/D16270 llvm-svn: 258133
* [clang-tidy] Fix a copy-paste error.Alexander Kornienko2016-01-151-1/+1
| | | | llvm-svn: 257900
* Teach clang-tidy how to upgrade warnings into errors.Jonathan Roelofs2016-01-137-18/+77
| | | | | | | | | Similar in format to the `-checks=` argument, this new `-warnings-as-errors=` argument upgrades any warnings emitted by the former to errors. http://reviews.llvm.org/D15528 llvm-svn: 257642
* [clang-tidy] Slightly clarified comments.Alexander Kornienko2016-01-131-2/+2
| | | | llvm-svn: 257600
* Support virtual-near-miss check.Alexander Kornienko2016-01-134-0/+335
| | | | | | | | | | | | | | Summary: Virtual function override near miss detection. Function complete. Test complete. Do not conduct Fix for now. Reviewers: alexfh Subscribers: cfe-commits Patch by Cong Liu! Differential Revision: http://reviews.llvm.org/D15823 llvm-svn: 257599
* Add documentation redirects for clang-tidy checkers that are exposed under ↵Aaron Ballman2016-01-111-7/+17
| | | | | | multiple checker names. Updates the Python script for adding checks to properly handle these aliases. llvm-svn: 257347
* [clang-tidy] Fix a false positive in google-runtime-memsetAlexander Kornienko2016-01-111-7/+11
| | | | | | | | | | | | | | | | | google-runtime-memset no longer issues a warning if the fill char value is known to be an invalid fill char count. Namely, it no longer warns for these: memset(p, 0, 0); memset(p, -1, 0); In both cases, swapping the last two args would either be useless (there is no actual bug) or wrong (it would introduce a bug). Patch by Matt Armstrong! llvm-svn: 257320
* [clang-tidy] Add non-inline function definition and variable definition ↵Alexander Kornienko2016-01-084-0/+173
| | | | | | | | | | | | | | | | check in header files. Summary: The new check will find all functionand variable definitions which may violate cpp one definition rule in header file. Reviewers: aaron.ballman, alexfh Subscribers: aaron.ballman, cfe-commits Patch by Haojian Wu! Differential Revision: http://reviews.llvm.org/D15710 llvm-svn: 257178
* Disable part of the misc-move-constructor-init checker when the check is ↵Aaron Ballman2016-01-084-16/+30
| | | | | | enabled through cert-oop11-cpp. The CERT guideline does not cover moveable parameters as part of the OOP11-CPP recommendation, just copy construction from move constructors. llvm-svn: 257177
OpenPOWER on IntegriCloud