summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/docs
Commit message (Collapse)AuthorAgeFilesLines
...
* [clang-tidy] Fix for commits rL372706 and rL372711Adam Balogh2019-10-021-1/+1
| | | | | | | | | The patch committed was not the accepted version but the previous one. This commit fixes this issue. Differential Revision: https://reviews.llvm.org/D64736 llvm-svn: 373428
* [clang-tidy] Rename objc-avoid-spinlock check to darwin-avoid-spinlockStephane Moore2019-10-013-4/+7
| | | | | | | | | | | | | | | | | | | | | | | Summary: OSSpinLock* are Apple/Darwin functions, but were previously located with ObjC checks as those were most closely tied to Apple platforms before. Now that there's a specific Darwin module, relocating the check there. This change was prepared by running rename_check.py. Contributed By: mwyman Reviewers: stephanemoore, dmaclach Reviewed By: stephanemoore Subscribers: Eugene.Zelenko, mgorny, xazax.hun, cfe-commits Tags: #clang-tools-extra, #clang, #llvm Differential Revision: https://reviews.llvm.org/D68148 llvm-svn: 373392
* [clang-tidy] New check to warn when storing dispatch_once_t in non-static, ↵Dmitri Gribenko2019-09-273-0/+29
| | | | | | | | | | | | | | | | | | | | | non-global storage. Summary: Creates a new darwin ClangTidy module and adds the darwin-dispatch-once-nonstatic check that warns about dispatch_once_t variables not in static or global storage. This catches a missing static for local variables in e.g. singleton initialization behavior, and also warns on storing dispatch_once_t values in Objective-C instance variables. C/C++ struct/class instances may potentially live in static/global storage, and are ignored for this check. The osx.API static analysis checker can find the non-static storage use of dispatch_once_t; I thought it useful to also catch this issue in clang-tidy when possible. This is a re-land of https://reviews.llvm.org/D67567 Reviewers: thakis, gribozavr, stephanemoore Subscribers: Eugene.Zelenko, mgorny, xazax.hun, jkorous, arphaman, kadircet, usaxena95 Tags: #clang-tools-extra, #clang, #llvm Differential Revision: https://reviews.llvm.org/D68109 llvm-svn: 373065
* Revert "[clang-tidy] New check to warn when storing dispatch_once_t in ↵Dmitri Gribenko2019-09-263-29/+0
| | | | | | | | non-static, non-global storage" This reverts commit r373028, because the new test fails on Linux. llvm-svn: 373032
* [clang-tidy] New check to warn when storing dispatch_once_t in non-static, ↵Stephane Moore2019-09-263-0/+29
| | | | | | | | | | | | | | | | | | | | | | | non-global storage Summary: Creates a new darwin ClangTidy module and adds the darwin-dispatch-once-nonstatic check that warns about dispatch_once_t variables not in static or global storage. This catches a missing static for local variables in e.g. singleton initialization behavior, and also warns on storing dispatch_once_t values in Objective-C instance variables. C/C++ struct/class instances may potentially live in static/global storage, and are ignored for this check. The osx.API static analysis checker can find the non-static storage use of dispatch_once_t; I thought it useful to also catch this issue in clang-tidy when possible. Contributed By: mwyman Reviewers: benhamilton, hokein, stephanemoore, aaron.ballman, gribozavr Reviewed By: stephanemoore, gribozavr Subscribers: jkorous, arphaman, kadircet, usaxena95, NoQ, xazax.hun, lebedev.ri, mgorny, cfe-commits Tags: #clang, #clang-tools-extra Differential Revision: https://reviews.llvm.org/D67567 llvm-svn: 373028
* [clangd] Fix the stale documentation about background indexing.Haojian Wu2019-09-251-17/+25
| | | | | | | | | | | | Reviewers: kadircet Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D66937 llvm-svn: 372825
* [clang-tidy] Add bugprone-infinite-loop.rst from D64736 to fix buildbotFangrui Song2019-09-241-0/+32
| | | | llvm-svn: 372711
* [clang-tidy] Add missing InfiniteLoopCheck.h, InfiniteLoopCheck.cpp and test ↵Fangrui Song2019-09-242-0/+7
| | | | | | from D64736 llvm-svn: 372706
* Revert rL372693 : [clang-tidy] New bugprone-infinite-loop check for ↵Simon Pilgrim2019-09-242-85/+0
| | | | | | | | | | | | | | | | | | detecting obvious infinite loops Finding infinite loops is well-known to be impossible (halting problem). However, it is possible to detect some obvious infinite loops, for example, if the loop condition is not changed. Detecting such loops is beneficial since the tests will hang on programs containing infinite loops so testing-time detection may be costly in large systems. Obvious cases are where the programmer forgets to increment/decrement the counter or increments/decrements the wrong variable. Differential Revision: https://reviews.llvm.org/D64736 ------- Broke some buildbots "No SOURCES given to target: obj.clangTidyBugproneModule" llvm-svn: 372704
* [clang-tidy] New bugprone-infinite-loop check for detecting obvious infinite ↵Adam Balogh2019-09-242-0/+85
| | | | | | | | | | | | | | | | loops Finding infinite loops is well-known to be impossible (halting problem). However, it is possible to detect some obvious infinite loops, for example, if the loop condition is not changed. Detecting such loops is beneficial since the tests will hang on programs containing infinite loops so testing-time detection may be costly in large systems. Obvious cases are where the programmer forgets to increment/decrement the counter or increments/decrements the wrong variable. Differential Revision: https://reviews.llvm.org/D64736 llvm-svn: 372693
* [Clang-doc] NFC: Fixed link to llvm bugs in documentationShaurya Gupta2019-09-231-1/+1
| | | | llvm-svn: 372627
* [clang-tidy] Add check for classes missing -hash ⚠️Stephane Moore2019-09-213-0/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Apple documentation states that: "If two objects are equal, they must have the same hash value. This last point is particularly important if you define isEqual: in a subclass and intend to put instances of that subclass into a collection. Make sure you also define hash in your subclass." https://developer.apple.com/documentation/objectivec/1418956-nsobject/1418795-isequal?language=objc In many or all versions of libobjc, -[NSObject isEqual:] is a pointer equality check and -[NSObject hash] returns the messaged object's pointer. A relatively common form of developer error is for a developer to override -isEqual: in a subclass without overriding -hash to ensure that hashes are equal for objects that are equal. It is assumed that an override of -isEqual: is a strong signal for changing the object's equality operator to something other than pointer equality which implies that a missing override of -hash could result in distinct objects being equal but having distinct hashes because they are independent instances. This added check flags classes that override -isEqual: but inherit NSObject's implementation of -hash to warn of the potential for unexpected behavior. The proper implementation of -hash is the responsibility of the developer and the check will only verify that the developer made an effort to properly implement -hash. Developers can set up unit tests to verify that their implementation of -hash is appropriate. Test Notes: Ran check-clang-tools. Reviewers: aaron.ballman, benhamilton Reviewed By: aaron.ballman Subscribers: Eugene.Zelenko, mgorny, xazax.hun, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D67737 llvm-svn: 372445
* [clang-tidy] add checks to bugprone-posix-returnJian Cai2019-09-162-3/+8
| | | | | | This check now also checks if any calls to pthread_* functions expect negative return values. These functions return either 0 on success or an errno on failure, which is positive only. llvm-svn: 372037
* Fix the rst doc, unbreak buildbot.Haojian Wu2019-09-161-0/+1
| | | | llvm-svn: 371968
* [clang-tidy] performance-inefficient-vector-operation: Support proto ↵Haojian Wu2019-09-161-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | repeated field Summary: Finds calls that add element to protobuf repeated field in a loop without calling Reserve() before the loop. Calling Reserve() first can avoid unnecessary memory reallocations. A new option EnableProto is added to guard this feature. Patch by Cong Liu! Reviewers: gribozavr, alexfh, hokein, aaron.ballman Reviewed By: hokein Subscribers: lebedev.ri, xazax.hun, Eugene.Zelenko, cfe-commits Tags: #clang, #clang-tools-extra Differential Revision: https://reviews.llvm.org/D67135 llvm-svn: 371963
* Add a bugprone-argument-comment option: IgnoreSingleArgument.Alexander Kornienko2019-09-051-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Add bugprone-argument-comment option: IgnoreSingleArgument. When true, the check will ignore the single argument. Sometimes, it's not necessary to add comment to single argument. For example: > std::string name("Yubo Xie"); > pScreen->SetWidth(1920); > pScreen->SetHeight(1080); This option can ignore such single argument in bugprone-argument-comment check. Reviewers: alexfh Reviewed By: alexfh Subscribers: cfe-commits Tags: #clang Patch by Yubo Xie. Differential Revision: https://reviews.llvm.org/D67056 llvm-svn: 371075
* [clang-tidy] Add llvm-prefer-register-over-unsigned to clang-tidyDaniel Sanders2019-08-303-0/+35
| | | | | | | | | | | | | | | | | Summary: This clang-tidy check is looking for unsigned integer variables whose initializer starts with an implicit cast from llvm::Register and changes the type of the variable to llvm::Register (dropping the llvm:: where possible). Reviewers: arsenm, bogner Subscribers: jholewinski, MatzeB, qcolombet, dschuff, jyknight, dylanmckay, sdardis, nemanjai, jvesely, wdng, nhaehnle, mgorny, sbc100, jgravelle-google, kristof.beyls, hiraditya, aheejin, kbarton, fedor.sergeev, javed.absar, asb, rbar, johnrusso, simoncook, apazos, sabuasal, niosHD, jrtc27, MaskRay, zzheng, edward-jones, atanasyan, rogfer01, MartinMosbeck, brucehoult, the_o, tpr, PkmX, jocewei, jsji, Petar.Avramovic, asbirlea, Jim, s.egerton, cfe-commits, llvm-commits Tags: #clang, #llvm Differential Revision: https://reviews.llvm.org/D65919 llvm-svn: 370512
* [clang-tidy] readability-identifier-naming shouldn't complain about CRTP ↵Sam McCall2019-08-281-0/+4
| | | | | | | | | | | | | | pseudo-overrides Reviewers: ilya-biryukov Subscribers: xazax.hun, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D66864 llvm-svn: 370193
* Remove clang-tidy-vs from clang-tools-extra (PR41791)Alex Lorenz2019-08-271-0/+8
| | | | | | | | | | | | | | | | | | | | | | The clang-tidy-vs visual studio plugin in clang-tools-extra contains a security vulnerability in the YamlDotNet package [1]. I posted to cfe-dev [2], asking if there was anyone who was interested in updating the the plugin to address the vulnerability. Reid mentioned that Zach (the original committer), said that there's another plugin (Clang Power Tools) that provides clang-tidy support, with additional extra features, so it would be ok to remove clang-tidy-vs. This commit removes the plugin to address the security vulnerability, and adds a section to the release notes that mentions that the plugin was removed, and suggests to use Clang Power Tools. Fixes PR 41791. [1]: https://nvd.nist.gov/vuln/detail/CVE-2018-1000210 [2]: http://lists.llvm.org/pipermail/cfe-dev/2019-August/063196.html Differential Revision: https://reviews.llvm.org/D66813 llvm-svn: 370096
* Revert "[clangd] Release notes" (wrong branch)Sam McCall2019-08-271-92/+1
| | | | | | This reverts commit 51029e5c153bd33efa015e2ec35b60247d046ce4. llvm-svn: 370022
* [clangd] Release notesSam McCall2019-08-261-1/+92
| | | | llvm-svn: 369934
* [clangd] Fix docsKadir Cetinkaya2019-08-261-2/+3
| | | | llvm-svn: 369920
* [clangd] Add docs for configuration knobs in clangdKadir Cetinkaya2019-08-262-0/+40
| | | | | | | | | | | | | | | | Summary: This is a first step in documenting different configuration knobs we have in clangd. Reviewers: sammccall Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D66740 llvm-svn: 369917
* Fix documentation build after rL369568Yuanfang Chen2019-08-211-5/+5
| | | | llvm-svn: 369578
* [clang-tidy] Check for dynamically initialized statics in headers.Yuanfang Chen2019-08-213-1/+34
| | | | | | | | | | | | Finds instances where variables with static storage are initialized dynamically in header files. Reviewed By: aaron.ballman, alexfh Patch by Charles Zhang! Differential Revision: https://reviews.llvm.org/D62829 llvm-svn: 369568
* [clangd] Update features table in the docs with links to LSP extension proposalsNathan Ridge2019-08-191-51/+55
| | | | | | | | | | | | | | | Also update the semantic coloring entry to reflect it being supported in clangd now. Reviewers: sammccall Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D65373 llvm-svn: 369229
* [clang-doc] Redesign of generated HTML filesDiego Astiazaran2019-08-161-0/+1
| | | | | | | | | | | | | The new design includes a header (contains the project name), a main section, and a footer. The main section is divided into three subsections. Left, middle, right. The left section contains the general index, the middle contains the info's data, and the right contains the index for the info's content. The CSS has been updated. A flag --project-name is added. The Attributes attribute of the TagNode struct is now a vector of pairs because these attributes should be rendered in the insertion order. The functions (cpp and js) that converts an Index tree structure into HTML were slightly modified; the first ul tag created is now a ol tag. The inner lists are still ul. Differential Revision: https://reviews.llvm.org/D66353 llvm-svn: 369139
* [clang-format] Add link to source code in file definitionsDiego Astiazaran2019-08-091-15/+25
| | | | | | | | | | | | | Two command line options have been added to clang-doc. --repository=<string> - URL of repository that hosts code; used for links to definition locations. --source-root=<string> - Directory where processed files are stored. Links to definition locations will only be generated if the file is in this dir. If the file is in the source-root and a repository options is passed; a link to the source code will be rendered by the HTML generator. Differential Revision: https://reviews.llvm.org/D65483 llvm-svn: 368460
* [clang-doc] Update documentationDiego Astiazaran2019-08-032-11/+41
| | | | | | | | | HTML generator has been included in clang-tools-extra release notes. clang-doc documentation file has been updated. Differential Revision: https://reviews.llvm.org/D65622 llvm-svn: 367743
* [clang-tidy] Adding static analyzer check to list of clang-tidy checksNathan Huckleberry2019-08-0286-0/+993
| | | | | | | | | | | | | | | | | | | Summary: Since clang-tidy supports use of the static analyzer there should be documentation of how to invoke the static analyzer checks. Reviewers: JonasToth, aaron.ballman, NoQ, Szelethus Reviewed By: aaron.ballman Subscribers: nickdesaulniers, lebedev.ri, jfb, NoQ, Eugene.Zelenko, xazax.hun, baloghadamsoftware, a.sidorin, Szelethus, donat.nagy, dkrupp, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D64454 llvm-svn: 367694
* [NFC] Remove LLVM_ALIGNASJF Bastien2019-07-311-1/+1
| | | | | | | | | | | | | | Summary: The minimum compilers support all have alignas, and we don't use LLVM_ALIGNAS anywhere anymore. This also removes an MSVC diagnostic which, according to the comment above, isn't relevant anymore. Reviewers: rnk Subscribers: mgorny, jkorous, dexonsmith, cfe-commits, llvm-commits Tags: #clang, #llvm Differential Revision: https://reviews.llvm.org/D65458 llvm-svn: 367383
* [clang-tidy] Fix the documentation for linuxkernel-must-use-errs.Tom Roeder2019-07-302-17/+11
| | | | | | | | | | | | | | | | | | | Summary: This changes ReleaseNotes.txt to have the first sentence of the full documentation from linuxkernel-must-use-errs.rst. This addresses a comment from the review of rL367071 in https://reviews.llvm.org/D59963. Reviewers: Eugene.Zelenko Subscribers: xazax.hun, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D65343 llvm-svn: 367333
* [clang-tidy]: Google: new check 'google-upgrade-googletest-case'Eric Fiselier2019-07-293-0/+61
| | | | | | | | | | | Introduce a new check to upgrade user code based on API changes in Googletest. The check finds uses of old Googletest APIs with "case" in their name and replaces them with the new APIs named with "suite". Patch by Alex Strelnikov (strel@google.com) Reviewed as D62977. llvm-svn: 367263
* [clang-tidy] Add a module for the Linux kernel.Tom Roeder2019-07-253-1/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Now that clang is going to be able to build the Linux kernel again on x86, and we have gen_compile_commands.py upstream for generating compile_commands.json, clang-tidy can be used on the Linux kernel source. To that end, this commit adds a new clang-tidy module to be used for checks specific to Linux kernel source. The Linux kernel follows its own style of C, and it will be useful to separate those checks into their own module. This also adds an initial check that makes sure that return values from the kernel error functions like PTR_ERR and ERR_PTR are checked. It also makes sure that any functions that directly return values from these functions are checked. Subscribers: xazax.hun, gribozavr, Eugene.Zelenko, lebedev.ri, mgorny, jdoerfert, cfe-commits Tags: #clang, #clang-tools-extra Reviewers: aaron.ballman, alexfh, hokein, JonasToth Differential Revision: https://reviews.llvm.org/D59963 llvm-svn: 367071
* Update documentation for all CERT checks that correspond to a recommendation.Aaron Ballman2019-07-224-5/+31
| | | | | | CERT removed their C++ secure coding recommendations from public view and so the links within that documentation are stale. This updates various pieces of documentation to make this more clear, and to help add substance where our docs deferred to CERT's wiki. llvm-svn: 366687
* Bump the trunk version to 10.0.0svnHans Wennborg2019-07-182-192/+11
| | | | | | and clear the release notes. llvm-svn: 366427
* clang-tidy release notes: Split and order changes by typeHans Wennborg2019-07-181-58/+61
| | | | | | Patch by Eugene Zelenko! llvm-svn: 366408
* [clang-tidy] initial version of readability-convert-member-functions-to-staticMatthias Gehre2019-07-163-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | Summary: Finds non-static member functions that can be made ``static``. I have run this check (repeatedly) over llvm-project. It made 1708 member functions ``static``. Out of those, I had to exclude 22 via ``NOLINT`` because their address was taken and stored in a variable of pointer-to-member type (e.g. passed to llvm::StringSwitch). It also made 243 member functions ``const``. (This is currently very conservative to have no false-positives and can hopefully be extended in the future.) You can find the results here: https://github.com/mgehre/llvm-project/commits/static_const_eval Reviewers: alexfh, aaron.ballman Subscribers: mgorny, xazax.hun, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D61749 llvm-svn: 366265
* [clangd] Fix docKadir Cetinkaya2019-07-151-1/+1
| | | | llvm-svn: 366073
* [clangd] Mark type hierarchy as a supported feature in the docsNathan Ridge2019-07-131-1/+1
| | | | | | | | | | | | Reviewers: sammccall Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D64614 llvm-svn: 365987
* Fixed a link in ReleaseNotes.rst (follow-up to r365007)Dmitri Gribenko2019-07-031-1/+1
| | | | llvm-svn: 365078
* [clang-tidy] new check: bugprone-posix-returnDmitri Gribenko2019-07-033-0/+27
| | | | | | | | | | | | | | | | | | | | Summary: Checks if any calls to posix functions (except posix_openpt) expect negative return values. These functions return either 0 on success or an errno on failure, which is positive only. Reviewers: JonasToth, gribozavr, alexfh, hokein Reviewed By: gribozavr Subscribers: Eugene.Zelenko, lebedev.ri, llozano, george.burgess.iv, xazax.hun, srhines, mgorny, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D63623 Patch by Jian Cai. llvm-svn: 365007
* Fixed two issues in clang-tidy -help.Alexander Kornienko2019-07-011-105/+105
| | | | | | HeaderFilter -> HeaderFilterRegex llvm-svn: 364837
* [clang-tidy] Update documentation for Qt Creator integration.Nikolai Kosjar2019-06-251-2/+4
| | | | | | | | | | Subscribers: xazax.hun, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D63763 llvm-svn: 364315
* [clang-tidy] Fix a typo in the doc.Haojian Wu2019-06-211-1/+1
| | | | llvm-svn: 364010
* [clang-tidy] Split fuchsia-default-argumentsJulie Hockett2019-06-184-8/+45
| | | | | | | | | | | | Splits fuchsia-default-arguments check into two checks. fuchsia-default-arguments-calls warns if a function or method is called with default arguments. fuchsia-default-arguments-declarations warns if a function or method is declared with default parameters. Committed on behalf of @diegoast (Diego Astiazarán). Resolves b38051. Differential Revision: https://reviews.llvm.org/D62437 llvm-svn: 363712
* [docs] Fix another bot warning by adding a blank line to separate the ↵Don Hinton2019-06-161-0/+1
| | | | | | `option::` command from the text below. llvm-svn: 363520
* [docs] Fix a few problems with clang-tool docs to get the bots green again.Don Hinton2019-06-162-2/+4
| | | | llvm-svn: 363518
* android: add a close-on-exec check on pipe()George Burgess IV2019-06-063-0/+26
| | | | | | | | | | | On Android, pipe() is better to be replaced by pipe2() with O_CLOEXEC flag to avoid file descriptor leakage. Patch by Jian Cai! Differential Revision: https://reviews.llvm.org/D61967 llvm-svn: 362673
* android: add a close-on-exec check on pipe2()George Burgess IV2019-06-063-0/+27
| | | | | | | | | | | On Android, pipe2() is better to set O_CLOEXEC flag to avoid file descriptor leakage. Patch by Jian Cai! Differential Revision: https://reviews.llvm.org/D62049 llvm-svn: 362672
OpenPOWER on IntegriCloud