summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/docs/clang-tidy
Commit message (Collapse)AuthorAgeFilesLines
...
* [clang-tidy] Add a check to detect static definitions in anonymous namespace.Haojian Wu2016-04-052-0/+18
| | | | | | | | | | | | Summary: Fixes PR26595 Reviewers: alexfh Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D18180 llvm-svn: 265384
* [clang-tidy] Fix documentation of misc-suspicious-missing-commaEtienne Bergeron2016-04-051-3/+12
| | | | | | | | | | | | | | | Summary: The clang-tidy documentation generation was broken since commit : http://reviews.llvm.org/D18457 I ran locally the documentation generation and I fixed errors related to that specific check. Reviewers: alexfh Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D18764 llvm-svn: 265375
* [Clang-tidy] Improve checks documentation consistency.Eugene Zelenko2016-04-0234-124/+85
| | | | | | Differential revision: http://reviews.llvm.org/D18717 llvm-svn: 265205
* Update release notes with list of checks added since 3.8.Eugene Zelenko2016-03-314-11/+13
| | | | | | | | Fix some checks documentation style. Differential revision: http://reviews.llvm.org/D18582 llvm-svn: 265072
* [clang-tidy] Add a new checker to detect missing comma in initializer list.Etienne Bergeron2016-03-312-0/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This checker is able to detect missing comma in an array of string literals. ``` const char* A[] = { "abc", "def" // missing comma (no compiler warnings) "ghi", }; ``` The ratio of false-positive is reduced by restricting the size of the array considered and the ratio of missing comma. To validate the quantity of false positive, the checker was tried over LLVM and chromium code and detected these cases: [[ http://reviews.llvm.org/D18454 | http://reviews.llvm.org/D18454 ]] [[https://codereview.chromium.org/1807753002/ | https://codereview.chromium.org/1807753002/]] [[https://codereview.chromium.org/1826193002/ | https://codereview.chromium.org/1826193002/]] [[https://codereview.chromium.org/1805713002/ | https://codereview.chromium.org/1805713002/]] Reviewers: alexfh Subscribers: LegalizeAdulthood, szdominik, xazax.hun, cfe-commits Differential Revision: http://reviews.llvm.org/D18457 llvm-svn: 265033
* [clang-tidy] readability check for const params in declarationsAlexander Kornienko2016-03-302-1/+19
| | | | | | | | | | | | | | Summary: Adds a clang-tidy warning for top-level consts in function declarations. Reviewers: hokein, sbenza, alexfh Subscribers: cfe-commits Patch by Matt Kulukundis! Differential Revision: http://reviews.llvm.org/D18408 llvm-svn: 264856
* [clang-tidy] Add check to detect dangling references in value handlers.Samuel Benzaquen2016-03-292-0/+35
| | | | | | | | | | | | | | | | | | | | | | Summary: Add check misc-dangling-handle to detect dangling references in value handlers like std::experimental::string_view. It provides a configuration option to specify other handle types that should also be checked. Right now it detects: - Construction from temporaries. - Assignment from temporaries. - Return statements from temporaries or locals. - Insertion into containers from temporaries. Reviewers: alexfh Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D17811 llvm-svn: 264759
* [clang-tidy] Add performance check to flag function parameters of expensive ↵Felix Berger2016-03-292-0/+34
| | | | | | | | | | | | to copy types that can be safely converted to const references. Reviewers: alexfh Subscribers: fowles, cfe-commits Differential Revision: http://reviews.llvm.org/D17491 llvm-svn: 264694
* clang-tidy: Add check modernize-raw-string-literalRichard Thomson2016-03-272-0/+47
| | | | llvm-svn: 264539
* Add clang-tools-extra release notesRichard Thomson2016-03-271-0/+1
| | | | llvm-svn: 264531
* Add check for unneeded copies of localsHaojian Wu2016-03-231-6/+9
| | | | | | | | | | | | | | 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-0/+34
| | | | | | | | | | | | | | | | 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
* fix some minor typos in the docSylvestre Ledru2016-03-032-4/+4
| | | | llvm-svn: 262655
* Fix two minor syntax issues in the documentationSylvestre Ledru2016-03-032-1/+2
| | | | llvm-svn: 262654
* [clang-tidy] Do not emit warnings from misc-suspicious-semicolon when the ↵Gabor Horvath2016-03-031-6/+6
| | | | | | compilation fails. llvm-svn: 262615
* [clang-tidy] Documentation fixes.Gabor Horvath2016-03-031-6/+6
| | | | llvm-svn: 262601
* [clang-tidy] Minor change in the docAlexander Kornienko2016-02-261-1/+1
| | | | llvm-svn: 261998
* Remove a blank line at EOF. NFCAlexander Kornienko2016-02-251-1/+0
| | | | llvm-svn: 261940
* Add a new check, readability-redundant-string-init, that checks unnecessary ↵Alexander Kornienko2016-02-252-0/+17
| | | | | | | | | | | | | | string initializations. Reviewers: hokein, alexfh Subscribers: cfe-commits Patch by Shuai Wang! Differential Revision: http://reviews.llvm.org/D17586 llvm-svn: 261939
* [clang-tidy] update links to Google Code Style in docsHaojian Wu2016-02-258-8/+8
| | | | | | | | | | | | | | Summary: Because of the recent Google Code shutdown links to the Google Code Style up there are no longer relevant. Reviewers: alexfh, hokein Subscribers: cfe-commits Patch by Kirill Bobyrev! Differential Revision: http://reviews.llvm.org/D17602 llvm-svn: 261868
* [clang-tidy] introduce modernize-deprecated-headers checkAlexander Kornienko2016-02-242-0/+46
| | | | | | | | | | | | | | | | | Summary: This patch introduces the modernize-deprecated-headers check, which is supposed to replace deprecated C library headers with the C++ STL-ones. For information see documentation; for exmaples see the test cases. Reviewers: Eugene.Zelenko, LegalizeAdulthood, alexfh Subscribers: cfe-commits Patch by Kirill Bobyrev! Differential Revision: http://reviews.llvm.org/D17484 llvm-svn: 261738
* [clang-tidy] Added a check for forward declaration in the potentially wrong ↵Alexander Kornienko2016-02-242-0/+20
| | | | | | | | | | | | | | | | | namespace Adds a new check "misc-forward-declaration-namespace". In check, A forward declaration is considerred in a potentially wrong namespace if there is any definition/declaration with the same name exists in a different namespace. Reviewers: akuegel, hokein, alexfh Patch by Eric Liu! Differential Revision: http://reviews.llvm.org/D17195 llvm-svn: 261737
* [clang-tidy] Updated docs on testing clang-tidy checks.Alexander Kornienko2016-02-231-2/+20
| | | | llvm-svn: 261622
* Add a new check, cert-env33-c, that diagnoses uses of system(), popen(), and ↵Aaron Ballman2016-02-222-0/+14
| | | | | | _popen() to execute a command processor. This check corresponds to the CERT secure coding rule: https://www.securecoding.cert.org/confluence/pages/viewpage.action?pageId=2130132 llvm-svn: 261530
* [clang-tidy] Describe modules, link to LLVM development docs, other minor ↵Alexander Kornienko2016-02-201-11/+46
| | | | | | updates llvm-svn: 261431
* Add a new check, cert-flp30-c, that diagnoses loop induction expressions of ↵Aaron Ballman2016-02-192-0/+12
| | | | | | floating-point type. This check corresponds to the CERT secure coding rule: https://www.securecoding.cert.org/confluence/display/c/FLP30-C.+Do+not+use+floating-point+variables+as+loop+counters llvm-svn: 261324
* fix an indent issue in the doc which causes sphinx to fail with some versionsSylvestre Ledru2016-02-151-1/+1
| | | | llvm-svn: 260912
* [clang-tidy] ClangTidy check to flag uninitialized builtin and pointer fields.Felix Berger2016-02-152-0/+19
| | | | | | | | | | | | | | | | | | | | | 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
* Improve documentationFelix Berger2016-02-151-2/+2
| | | | llvm-svn: 260869
* [clang-tidy] Add check performance-faster-string-findSamuel Benzaquen2016-02-122-0/+23
| | | | | | | | | | | | | | 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-121-4/+7
| | | | | | | | | | | | 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] Add a check to find unintended semicolons that changes the ↵Gabor Horvath2016-02-112-0/+73
| | | | | | | | | | 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-092-0/+40
| | | | | | | | | | Reviewers: alexfh Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D16310 llvm-svn: 260223
* [clang-tidy] Fix assertion failure on `at` function in modernize-loop-convert.Haojian Wu2016-02-081-1/+1
| | | | | | | | | | Reviewers: alexfh Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D16926 llvm-svn: 260107
* [clang-tidy] Reshuffled paragraphs a bit, added contents.Alexander Kornienko2016-02-081-13/+19
| | | | llvm-svn: 260100
* [clang-tidy] Fix an error in .rstAlexander Kornienko2016-02-081-2/+4
| | | | llvm-svn: 260099
* [clang-tidy] Update documentationAlexander Kornienko2016-02-081-0/+9
| | | | | | | | | | | | Summary: We have 2 scripts add_new_check.py and rename_check.py to bootstrap a new check creation. There is also clang-query to aid with the matcher creation. These were not mentioned in the current document, add them so it's available to the masses. Reviewers: alexfh Patch by Deniz Türkoglu! Differential Revision: http://reviews.llvm.org/D16944 llvm-svn: 260098
* Reverting r260096; it causes build bot failures:Aaron Ballman2016-02-081-7/+4
| | | | | | | 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-081-4/+7
| | | | | | | | | | | | 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-082-0/+13
| | | | | | | | | | | | 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-60/+85
| | | | llvm-svn: 260065
* [clang-tidy] Add non-constant references in function parameters check.Alexander Kornienko2016-02-022-0/+8
| | | | | | | | | | | | | | | 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
* Add a new check, readability-redundant-control-flow, that check for some ↵Aaron Ballman2016-02-012-0/+51
| | | | | | | | 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] ForRangeCopyCheck that warns on and fixes unnecessary copies of ↵Alexander Kornienko2016-01-292-0/+20
| | | | | | | | | | loop variables. Patch by Felix Berger! Differential revision: http://reviews.llvm.org/D13849 llvm-svn: 259199
* Fixed function params comparison. Updated docs and tests.Alexander Kornienko2016-01-291-1/+1
| | | | | | | | | | | | | | 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] Move implicit-cast-in-loop check to upstream.Alexander Kornienko2016-01-292-0/+20
| | | | | | | | | | | | | | 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
* [clang-tidy] Fix documentation.Alexander Kornienko2016-01-2710-35/+53
| | | | | | | | | | Fixed broken links to cppcoreguidelines (anchors specified in the .md file should be used, not automatic anchors generated by github). Fixed formatting, array_view -> span, fixed sphinx errors in misc-definitions-in-headers.rst. llvm-svn: 258926
* [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] Fixed wording ("clang-tidy check", not "clang-tidy checker")Alexander Kornienko2016-01-1812-12/+12
| | | | llvm-svn: 258098
* Teach clang-tidy how to upgrade warnings into errors.Jonathan Roelofs2016-01-131-1/+4
| | | | | | | | | 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
OpenPOWER on IntegriCloud