summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/docs
Commit message (Collapse)AuthorAgeFilesLines
...
* [clang-tidy] Add new readability non-idiomatic static access checkGabor Horvath2017-08-083-0/+37
| | | | | | | | Patch by: Lilla Barancsuk Differential Revision: https://reviews.llvm.org/D35937 llvm-svn: 310371
* [clang-tidy] 'implicit cast' -> 'implicit conversion'Alexander Kornienko2017-08-086-143/+180
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch renames checks, check options and changes messages to use correct term "implicit conversion" instead of "implicit cast" (which has been in use in Clang AST since ~10 years, but it's still technically incorrect w.r.t. C++ standard). * performance-implicit-cast-in-loop -> performance-implicit-conversion-in-loop * readability-implicit-bool-cast -> readability-implicit-bool-conversion - readability-implicit-bool-cast.AllowConditionalIntegerCasts -> readability-implicit-bool-conversion.AllowIntegerConditions - readability-implicit-bool-cast.AllowConditionalPointerCasts -> readability-implicit-bool-conversion.AllowPointerConditions Reviewers: hokein, jdennett Reviewed By: hokein Subscribers: mgorny, JDevlieghere, xazax.hun, cfe-commits Differential Revision: https://reviews.llvm.org/D36456 llvm-svn: 310366
* [clang-tidy] Add missing documents for "IgnoreMacros" option.Haojian Wu2017-08-044-0/+29
| | | | llvm-svn: 310051
* [clang-tidy] Ignore macros in make-unique check.Haojian Wu2017-08-041-0/+5
| | | | | | | | | | | | | | | | Summary: The check doesn't fully support smart-ptr usages inside macros, which may cause incorrect fixes, or even crashes, ignore them for now. Reviewers: alexfh Reviewed By: alexfh Subscribers: JDevlieghere, xazax.hun, cfe-commits Differential Revision: https://reviews.llvm.org/D36264 llvm-svn: 310050
* Clear release notes for 6.0.0Hans Wennborg2017-07-191-124/+5
| | | | llvm-svn: 308479
* Bump docs version to 6.0Hans Wennborg2017-07-191-2/+2
| | | | llvm-svn: 308467
* [clang-tidy] Minor documentation fix. NFC.Gabor Horvath2017-07-141-1/+1
| | | | llvm-svn: 308022
* [clang-tidy] Add bugprone-undefined-memory-manipulation checkGabor Horvath2017-07-143-0/+14
| | | | | | | | Patch by: Reka Nikolett Kovacs Differential Revision: https://reviews.llvm.org/D35051 llvm-svn: 308021
* [clang-tidy] Add bugprone-suspicious-memset-usage checkGabor Horvath2017-07-145-11/+66
| | | | | | | | | | | | | | | | | | Created new module bugprone and placed the check in that. Finds memset() calls with potential mistakes in their arguments. Replaces and extends the existing google-runtime-memset-zero-length check. Cases covered: * Fill value is a character '0'. Integer 0 might have been intended. * Fill value is out of char range and gets truncated. * Byte count is zero. Potentially swapped with the fill value argument. Patch by: Reka Nikolett Kovacs Differential Revision: https://reviews.llvm.org/D32700 llvm-svn: 308020
* [clang-tidy] Add a new Android check "android-cloexec-socket"Yan Wang2017-07-123-0/+25
| | | | | | | | | | | | | | | | Summary: socket() is better to include SOCK_CLOEXEC in its type argument to avoid the file descriptor leakage. Reviewers: chh, Eugene.Zelenko, alexfh, hokein, aaron.ballman Reviewed By: chh, alexfh Subscribers: srhines, mgorny, JDevlieghere, xazax.hun, cfe-commits Tags: #clang-tools-extra Differential Revision: https://reviews.llvm.org/D34913 llvm-svn: 307818
* [clang-tidy] Add new modernize use unary assert checkGabor Horvath2017-07-123-0/+32
| | | | | | | | Patch by: Lilla Barancsuk Differential Revision: https://reviews.llvm.org/D35257 llvm-svn: 307791
* [clang-tidy] Add "MakeSmartPtrFunction" option to ↵Haojian Wu2017-07-052-0/+36
| | | | | | | | | | | | | | modernize-make-shared/unique checks. Reviewers: alexfh, aaron.ballman Reviewed By: alexfh Subscribers: JDevlieghere, Eugene.Zelenko, xazax.hun, cfe-commits Differential Revision: https://reviews.llvm.org/D34206 llvm-svn: 307130
* Fix some typos in the docSylvestre Ledru2017-06-292-9/+9
| | | | llvm-svn: 306750
* [clang-tidy] Rename android-file-open-flag and fix a bugYan Wang2017-06-293-6/+6
| | | | | | | | | | | | | | | | | | Summary: 1. Rename android-file-open-flag to android-cloexec-open. 2. Handle a case when the function is passed as an argument of a function-like macro. Reviewers: chh Reviewed By: chh Subscribers: srhines, mgorny, JDevlieghere, xazax.hun, cfe-commits Tags: #clang-tools-extra Differential Revision: https://reviews.llvm.org/D34633 llvm-svn: 306728
* [clang-tidy] Add docs to toctreeYan Wang2017-06-291-0/+2
| | | | | | | | | | | | | | Summary: Add .rst files to toctree. Fix buildbot error. Reviewers: chh Reviewed By: chh Subscribers: srhines, JDevlieghere, xazax.hun Differential Revision: https://reviews.llvm.org/D34825 llvm-svn: 306719
* [clang-tidy][Part3] Add a new module Android and three new checks.Yan Wang2017-06-292-0/+23
| | | | | | | | | | | | | | | | Summary: -- fopen() should include "e" in their mode string. [android-fopen-mode] Reviewers: chh, alexfh, aaron.ballman, hokein Reviewed By: hokein Subscribers: JDevlieghere, srhines, mgorny, xazax.hun Tags: #clang-tools-extra Differential Revision: https://reviews.llvm.org/D33747 llvm-svn: 306709
* [clang-tidy][Part2] Add a new module Android and three new checksYan Wang2017-06-292-0/+21
| | | | | | | | | | | | | | | | Summary: -- creat() should be replaced by open(). [android-creat-usage] Reviewers: chh, alexfh, aaron.ballman, hokein Reviewed By: hokein Subscribers: JDevlieghere, srhines, mgorny, xazax.hun Tags: #clang-tools-extra Differential Revision: https://reviews.llvm.org/D33745 llvm-svn: 306708
* [clang-tidy] follow-up on misc-definitions-in-header check.Haojian Wu2017-06-291-0/+2
| | | | | | | | | | | | | | | | | Summary: A follow-up on D34449: * add `-std=c++11` to `.hpp` file by default. * add constexpr function to test and doc. Reviewers: alexfh Reviewed By: alexfh Subscribers: JDevlieghere, xazax.hun, cfe-commits Differential Revision: https://reviews.llvm.org/D34771 llvm-svn: 306650
* [clangd] Cleanup ClangdUnit.cpp, update docs; NFCKirill Bobyrev2017-06-281-2/+2
| | | | | | | | * Enforce 80 characters limit where appropriate * Use slightly more descriptive names for searched locations * Update docs to reflect D34269, which adds "Go To Declaration" functionality llvm-svn: 306598
* [clang-tidy] Enable inline variable definitions in headersGabor Horvath2017-06-281-0/+8
| | | | | | Differential Revision: https://reviews.llvm.org/D34449 llvm-svn: 306538
* Remove the script dump_check_docs.py. It was a one-shot migration script.Sylvestre Ledru2017-06-261-79/+0
| | | | | | Sign off from Alexander Kornienko by email llvm-svn: 306263
* [clang-tidy] doc format fixYan Wang2017-06-231-1/+1
| | | | | | | | | | | | | | | | Summary: The url in the doc is wrong. Fix the url. Reviewers: chh Reviewed By: chh Subscribers: srhines, xazax.hun Tags: #clang-tools-extra Differential Revision: https://reviews.llvm.org/D34573 llvm-svn: 306172
* [clang-tidy][Part1] Add a new module Android and three new checks.Yan Wang2017-06-234-0/+32
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: A common source of security bugs is code that opens a file descriptors without using the O_CLOEXEC flag. (Without that flag, an opened sensitive file would remain open across a fork+exec to a lower-privileged SELinux domain, leaking that sensitive data.). Add a new Android module and one checks in clang-tidy. -- open(), openat(), and open64() should include O_CLOEXEC in their flags argument. [android-file-open-flag] Links to part2 and part3: https://reviews.llvm.org/D33745 https://reviews.llvm.org/D33747 Reviewers: chh, alexfh, aaron.ballman, hokein Reviewed By: alexfh, hokein Subscribers: jbcoe, joerg, malcolm.parsons, Eugene.Zelenko, srhines, mgorny, xazax.hun, cfe-commits, krytarowski Tags: #clang-tools-extra Differential Revision: https://reviews.llvm.org/D33304 llvm-svn: 306165
* [clang-tidy] readability-function-size: add NestingThreshold param.Roman Lebedev2017-06-092-1/+12
| | | | | | | | | | | | | | | | | | | | | | | | Summary: Finds compound statements which create next nesting level after `NestingThreshold` and emits a warning. Do note that it warns about each compound statement that breaches the threshold, but not any of it's sub-statements, to have readable warnings. I was able to find only one coding style referencing nesting: - https://www.kernel.org/doc/html/v4.10/process/coding-style.html#indentation > In short, 8-char indents make things easier to read, and have the added benefit of warning you when you’re nesting your functions too deep. This seems too basic, i'm not sure what else to test. Are more tests needed? Reviewers: alexfh, aaron.ballman, sbenza Reviewed By: alexfh, aaron.ballman Subscribers: xazax.hun Tags: #clang-tools-extra Differential Revision: https://reviews.llvm.org/D32942 llvm-svn: 305082
* [clang-tools-extra] ReleaseNotes.rst: test commit: whitespace fixRoman Lebedev2017-06-091-3/+3
| | | | llvm-svn: 305067
* [clang-tidy] New checker to replace dynamic exception specificationsAlexander Kornienko2017-06-083-0/+96
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: New checker to replace dynamic exception specifications This is an alternative to D18575 which relied on reparsing the decl to find the location of dynamic exception specifications, but couldn't deal with preprocessor conditionals correctly without reparsing the entire file. This approach uses D20428 to find dynamic exception specification locations and handles all cases correctly. Reviewers: aaron.ballman, alexfh Reviewed By: aaron.ballman, alexfh Subscribers: xazax.hun, mgehre, malcolm.parsons, mgorny, JDevlieghere, cfe-commits, Eugene.Zelenko, etienneb Patch by Don Hinton! Differential Revision: https://reviews.llvm.org/D20693 llvm-svn: 304977
* Fix formatting in docs.Alexander Kornienko2017-06-021-8/+7
| | | | llvm-svn: 304581
* [clang-tidy] check for __func__/__FUNCTION__ in lambdasAlexander Kornienko2017-06-023-0/+33
| | | | | | | | | | | | Add a clang-tidy check for using func__/FUNCTION__ inside lambdas. This evaluates to the string operator(), which is almost never useful and almost certainly not what the author intended. Patch by Bryce Liu! Differential Revision: https://reviews.llvm.org/D33497 llvm-svn: 304570
* clang-rename: add new -force optionMiklos Vajna2017-06-021-0/+1
| | | | | | | | | | | | | | | | | Summary: The use-case is when renaming a widely used name, like a lower-level class in a codebase and clang-rename is simply invoked for each translation unit based on the compile database. In this case it's not interesting to show errors: not finding the symbol means there is simply nothing to do. Reviewers: klimek Reviewed By: klimek Differential Revision: https://reviews.llvm.org/D32403 llvm-svn: 304534
* [Documentation] Mention hicpp check group in Clang-tidy main document.Eugene Zelenko2017-05-251-2/+3
| | | | llvm-svn: 303884
* [clang-tidy] Add "emplace_back" detection in inefficient-vector-operation.Haojian Wu2017-05-161-3/+3
| | | | | | | | | | | | | | Reviewers: alexfh, aaron.ballman Reviewed By: alexfh Subscribers: cfe-commits, Prazek, malcolm.parsons, xazax.hun Tags: #clang-tools-extra Differential Revision: https://reviews.llvm.org/D33209 llvm-svn: 303157
* [clang-tidy] modernize-use-emplace: Remove unnecessary make_tuple callsJakub Kuderski2017-05-162-2/+38
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch makes modernize-use-emplace remove unnecessary make_ calls from push_back calls and turn them into emplace_back -- the same way make_pair calls are handled. Custom make_ calls can be removed for custom tuple-like types -- two new options that control that are `TupleTypes` and `TupleMakeFunctions`. By default, the check removes calls to `std::make_pair` and `std::make_tuple`. Eq. ``` std::vector<std::tuple<int, char, bool>> v; v.push_back(std::make_tuple(1, 'A', true)); // --> v.emplace_back(1, 'A', true); ``` Reviewers: alexfh, aaron.ballman, Prazek, hokein Reviewed By: Prazek Subscribers: JDevlieghere, xazax.hun, JonasToth, cfe-commits Tags: #clang-tools-extra Differential Revision: https://reviews.llvm.org/D32690 llvm-svn: 303145
* Revert "[clang-tidy] modernize-use-emplace: Remove unnecessary make_tuple calls"Jakub Kuderski2017-05-162-38/+2
| | | | | | This reverts commit r303139. The commit made docs build emit a warning. llvm-svn: 303140
* [clang-tidy] modernize-use-emplace: Remove unnecessary make_tuple callsJakub Kuderski2017-05-162-2/+38
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch makes modernize-use-emplace remove unnecessary make_ calls from push_back calls and turn them into emplace_back -- the same way make_pair calls are handled. Custom make_ calls can be removed for custom tuple-like types -- two new options that control that are `TupleTypes` and `TupleMakeFunctions`. By default, the check removes calls to `std::make_pair` and `std::make_tuple`. Eq. ``` std::vector<std::tuple<int, char, bool>> v; v.push_back(std::make_tuple(1, 'A', true)); // --> v.emplace_back(1, 'A', true); ``` Reviewers: alexfh, aaron.ballman, Prazek, hokein Reviewed By: Prazek Subscribers: JDevlieghere, xazax.hun, JonasToth, cfe-commits Tags: #clang-tools-extra Differential Revision: https://reviews.llvm.org/D32690 llvm-svn: 303139
* [clang-tidy] Add new cert-dcl21-cpp check Gabor Horvath2017-05-103-0/+18
| | | | | | | | | This check flags postfix operator++/-- declarations, where the return type is not a const object. Differential Revision: https://reviews.llvm.org/D32743 llvm-svn: 302637
* docs: Fix Sphinx detection with out-of-tree buildsTom Stellard2017-05-091-1/+1
| | | | | | Adapt to changes made in r302499. llvm-svn: 302516
* clang-tidy: add IgnoreMacros option to modernize-use-default-member-initMiklos Vajna2017-05-081-0/+5
| | | | | | | | | | | | | | | | | | | Summary: And also enable it by default to be consistent with e.g. modernize-use-using. This helps e.g. when running this check on cppunit client code where the macro is provided by the system, so there is no easy way to modify it. Reviewers: alexfh, malcolm.parsons Reviewed By: malcolm.parsons Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D32945 llvm-svn: 302429
* [clangd] Add documentation pageMarc-Andre Laperle2017-05-042-0/+107
| | | | | | | | | | | | | | | | | | | Summary: Add a simple documentation page for Clangd. This will be useful for interested users and contributors to get basic information about how to get started and the progress of Clangd. Reviewers: krasimir, bkramer Reviewed By: krasimir Subscribers: Prazek, jbcoe, JDevlieghere, mgehre, JonasToth, kromanenkov, xazax.hun, cfe-commits Tags: #clang-tools-extra Differential Revision: https://reviews.llvm.org/D31887 llvm-svn: 302191
* Reorder release notes, fix missing link and a grammar issue. Gabor Horvath2017-05-011-23/+24
| | | | | | Patch by Réka Nikolett Kovács! llvm-svn: 301836
* [clang-tidy] modernize-use-emplace: remove unnecessary make_pair callsJakub Kuderski2017-04-282-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: When there is a push_back with a call to make_pair, turn it into emplace_back and remove the unnecessary make_pair call. Eg. ``` std::vector<std::pair<int, int>> v; v.push_back(std::make_pair(1, 2)); // --> v.emplace_back(1, 2); ``` make_pair doesn't get removed when explicit template parameters are provided, because of potential problems with type conversions. Reviewers: Prazek, aaron.ballman, hokein, alexfh Reviewed By: Prazek, alexfh Subscribers: JDevlieghere, JonasToth, cfe-commits Tags: #clang-tools-extra Differential Revision: https://reviews.llvm.org/D32395 llvm-svn: 301651
* [clang-tidy] Support detecting for-range loop in ↵Haojian Wu2017-04-261-4/+33
| | | | | | | | | | | | | | | | | | inefficient-vector-operation check. Summary: Also add an option "VectorLikeClasses" allowing user specify customized vectors. Reviewers: alexfh, aaron.ballman Reviewed By: alexfh Subscribers: Eugene.Zelenko, cfe-commits Differential Revision: https://reviews.llvm.org/D32436 llvm-svn: 301440
* [clang-tidy] New check: modernize-replace-random-shuffle.Mads Ravn2017-04-243-0/+34
| | | | | | | | | | | | | | | | | | | | | | This check will find occurrences of ``std::random_shuffle`` and replace it with ``std::shuffle``. In C++17 ``std::random_shuffle`` will no longer be available and thus we need to replace it. Example of case that it fixes ``` std::vector<int> v; // First example std::random_shuffle(vec.begin(), vec.end()); ``` Reviewers: hokein, aaron.ballman, alexfh, malcolm.parsons, mclow.lists Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D30158 llvm-svn: 301167
* [clang-tidy] Add a clang-tidy check for possible inefficient vector operationsHaojian Wu2017-04-183-1/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The "performance-inefficient-vector-operation" check finds vector oprations in for-loop statements which may cause multiple memory reallocations. This is the first version, only detects typical for-loop: ``` std::vector<int> v; for (int i = 0; i < n; ++i) { v.push_back(i); } // or for (int i = 0; i < v2.size(); ++i) { v.push_back(v2[i]); } ``` We can extend it to handle more cases like for-range loop in the future. Reviewers: alexfh, aaron.ballman Reviewed By: aaron.ballman Subscribers: zaks.anna, Eugene.Zelenko, mgorny, cfe-commits, djasper Differential Revision: https://reviews.llvm.org/D31757 llvm-svn: 300534
* Add the definition of P in the clang tidy exampleSylvestre Ledru2017-04-111-0/+2
| | | | llvm-svn: 299961
* Add more examples to clang tidy checkersSylvestre Ledru2017-04-117-0/+81
| | | | | | | | | | | | | | Reviewers: alexfh Reviewed By: alexfh Subscribers: cfe-commits Tags: #clang-tools-extra Differential Revision: https://reviews.llvm.org/D31860 llvm-svn: 299920
* [clang-tidy] Update docs and help messageAlexander Kornienko2017-04-061-4/+4
| | | | llvm-svn: 299651
* [clang-tidy] Check for forwarding reference overload in constructors.Gabor Horvath2017-04-063-0/+55
| | | | | | | | Patch by András Leitereg! Differential Revision: https://reviews.llvm.org/D30547 llvm-svn: 299638
* [clang-tidy] Correct code-block in the doc.Haojian Wu2017-03-311-1/+1
| | | | llvm-svn: 299190
* [clang-tidy] fix docs in hicpp checksJonathan Coe2017-03-302-1/+13
| | | | | | Fix for sphinx-doc warnings in r299068. llvm-svn: 299071
* [clang-tidy] add aliases for hicpp moduleJonathan Coe2017-03-3013-3/+122
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Add some hicpp checks that can be implmented as alises for existing clang-tidy checks: hicpp-explicit-conversions hicpp-function-size hicpp-named-parameter hicpp-invalid-access-moved hicpp-member-init hicpp-new-delete-operators hicpp-noexcept-move hicpp-special-member-functions hicpp-undelegated-constructor hicpp-use-equals-default hicpp-use-equals-delete hicpp-use-override Reviewers: dberlin, jbcoe, aaron.ballman, alexfh Reviewed By: aaron.ballman Subscribers: JDevlieghere Differential Revision: https://reviews.llvm.org/D30383 Patch By: Jonas Toth llvm-svn: 299068
OpenPOWER on IntegriCloud