| Commit message (Collapse) | Author | Age | Files | Lines | |
|---|---|---|---|---|---|
| * | [clang-tidy] Store checks profiling info as JSON files | Roman Lebedev | 2018-06-06 | 1 | -0/+12 |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Continuation of D46504. Example output: ``` $ clang-tidy -enable-check-profile -store-check-profile=. -checks=-*,readability-function-size source.cpp $ # Note that there won't be timings table printed to the console. $ cat *.json { "file": "/path/to/source.cpp", "timestamp": "2018-05-16 16:13:18.717446360", "profile": { "time.clang-tidy.readability-function-size.wall": 1.0421266555786133e+00, "time.clang-tidy.readability-function-size.user": 9.2088400000005421e-01, "time.clang-tidy.readability-function-size.sys": 1.2418899999999974e-01 } } ``` There are two arguments that control profile storage: * `-store-check-profile=<prefix>` By default reports are printed in tabulated format to stderr. When this option is passed, these per-TU profiles are instead stored as JSON. If the prefix is not an absolute path, it is considered to be relative to the directory from where you have run :program:`clang-tidy`. All `.` and `..` patterns in the path are collapsed, and symlinks are resolved. Example: Let's suppose you have a source file named `example.cpp`, located in `/source` directory. * If you specify `-store-check-profile=/tmp`, then the profile will be saved to `/tmp/<timestamp>-example.cpp.json` * If you run :program:`clang-tidy` from within `/foo` directory, and specify `-store-check-profile=.`, then the profile will still be saved to `/foo/<timestamp>-example.cpp.json` Reviewers: alexfh, sbenza, george.karpenkov, NoQ, aaron.ballman Reviewed By: alexfh, george.karpenkov, aaron.ballman Subscribers: Quuxplusone, JonasToth, aaron.ballman, llvm-commits, rja, Eugene.Zelenko, xazax.hun, mgrang, cfe-commits Tags: #clang-tools-extra Differential Revision: https://reviews.llvm.org/D46602 llvm-svn: 334101 | ||||
| * | [clang-tidy] Add a flag to enable alpha checkers | Alexander Kornienko | 2018-05-17 | 1 | -2/+4 |
| | | | | | | | | | | | | | | | | | Summary: The alpha checkers can already be enabled using the clang driver, this allows them to be enabled using the clang-tidy as well. This can make it easier to test the alpha checkers with projects which already support the compile_commands.json. It will also allow more people to give feedback and patches about the alpha checkers since they can run it as part of clang tidy checks. Reviewers: aaron.ballman, hokein, ilya-biryukov, alexfh, lebedev.ri, xbolva00 Reviewed By: aaron.ballman, alexfh, lebedev.ri, xbolva00 Subscribers: xbolva00, NoQ, dcoughlin, lebedev.ri, xazax.hun, cfe-commits Patch by Paul Fultz II! Differential Revision: https://reviews.llvm.org/D46159 llvm-svn: 332609 | ||||
| * | [clang-tidy] Profile is a per-AST (per-TU) data. | Roman Lebedev | 2018-05-08 | 1 | -2/+2 |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: As discussed in D45931, currently, profiling output of clang-tidy is somewhat not great. It outputs one profile at the end of the execution, and that profile contains the data from the last TU that was processed. So if the tool run on multiple TU's, the data is not accumulated, it is simply discarded. It would be nice to improve this. This differential is the first step - make this profiling info per-TU, and output it after the tool has finished processing each TU. In particular, when `ClangTidyASTConsumer` destructor runs. Next step will be to add a CSV (JSON?) printer to store said profiles under user-specified directory prefix. Reviewers: alexfh, sbenza Reviewed By: alexfh Subscribers: Eugene.Zelenko, mgorny, xazax.hun, mgrang, klimek, cfe-commits Tags: #clang-tools-extra Differential Revision: https://reviews.llvm.org/D46504 llvm-svn: 331763 | ||||
| * | Fix up after clang r331155. | Richard Smith | 2018-04-30 | 1 | -1/+1 |
| | | | | | llvm-svn: 331156 | ||||
| * | Add support for NOLINT and NOLINTNEXTLINE comments mentioning specific check ↵ | Aaron Ballman | 2017-12-14 | 1 | -8/+41 |
| | | | | | | | | | | | names. Supports a comma-separated list of check names to be disabled on the given line. Also supports * as a wildcard to disable all lint diagnostic messages on that line. Patch by Anton (xgsa). llvm-svn: 320713 | ||||
| * | [clang-tidy] Ignore newlines in checks list | Alexander Kornienko | 2017-08-09 | 1 | -1/+1 |
| | | | | | | | | This is a follow up to https://reviews.llvm.org/D30567 where I overlooked that LLVM YAML parser doesn't support multiline literal folding. llvm-svn: 310491 | ||||
| * | [NFC] Update to account for DiagnosticRenderer use of FullSourceLoc | Peter Smith | 2017-06-27 | 1 | -25/+22 |
| | | | | | | | | | | | | | | | D31709 [NFC] Refactor DiagnosticRenderer to use FullSourceLoc was committed in r305684 and reverted in 305688 as clang-tidy and clang-query failed to build. This change updates the extra tools to use the new interface. Reviewers: christof, rnk, rsmith, rovka, alexfh Reviewed By: alexfh Differential Revision: https://reviews.llvm.org/D34513 llvm-svn: 306385 | ||||
| * | Fix 'not all control paths return a value' warning on windows buildbots. | Simon Pilgrim | 2017-05-18 | 1 | -0/+1 |
| | | | | | llvm-svn: 303344 | ||||
| * | [clang-tidy] Optimize GlobList::contains | Alexander Kornienko | 2017-05-18 | 1 | -6/+29 |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With large lists of checks and large number of warnings GlobList::contains starts being ridiculously CPU hungry, since it runs regexp match per glob. Caching results of glob matching in a StringMap significantly speeds up check filtering even for small GlobLists. /tmp/q.cc: void f() { int I; {int I;} {int I;} {int I;} ... // 200k times } Before the patch: GlobList with 2 entries: $ time clang-tidy-old -checks=-*,modernize-use-override /tmp/q.cc -- -Wshadow 200000 warnings generated. Suppressed 200000 warnings (200000 with check filters). real 0m3.826s user 0m3.176s sys 0m0.504s GlobList with 28 entries: $ time clang-tidy-old -checks=-*,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,modernize-use-override /tmp/q.cc -- -Wshadow 200000 warnings generated. Suppressed 200000 warnings (200000 with check filters). real 0m5.000s user 0m4.744s sys 0m0.060s GlobList with 158 entries: $ time clang-tidy-old -checks=-*,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,modernize-use-override /tmp/q.cc -- -Wshadow 200000 warnings generated. Suppressed 200000 warnings (200000 with check filters). real 0m13.920s user 0m13.636s sys 0m0.104s With the patch runtime is practically independent from the length of the GlobList: $ time clang-tidy-new -checks=-*,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,modernize-use-override /tmp/q.cc -- -Wshadow 200000 warnings generated. Suppressed 200000 warnings (200000 with check filters). real 0m2.300s user 0m2.104s sys 0m0.044s llvm-svn: 303321 | ||||
| * | Change getChecksFilter() interface to hide implementation details. | Alexander Kornienko | 2017-05-17 | 1 | -8/+7 |
| | | | | | llvm-svn: 303264 | ||||
| * | [clang-tidy] Allow disabling compatibility check for generated fixes. | Alexander Kornienko | 2017-05-09 | 1 | -4/+8 |
| | | | | | llvm-svn: 302536 | ||||
| * | Change EOL style to LF. NFC | Alexander Kornienko | 2017-05-09 | 1 | -619/+619 |
| | | | | | llvm-svn: 302534 | ||||
| * | [clang-tidy] Fix treating non-space whitespaces in checks list. | Marek Kurdej | 2017-03-23 | 1 | -618/+619 |
| | | | | | | | | | | | | | | | | | Summary: This furtherly improves r295303: [clang-tidy] Ignore spaces between globs in the Checks option. Trims all whitespaces and not only spaces and correctly computes the offset of the checks list (taking the size before trimming). Reviewers: alexfh Reviewed By: alexfh Subscribers: cfe-commits, JDevlieghere Differential Revision: https://reviews.llvm.org/D30567 llvm-svn: 298621 | ||||
| * | [clang-tidy] Ignore spaces between globs in the Checks option. | Alexander Kornienko | 2017-02-16 | 1 | -0/+1 |
| | | | | | llvm-svn: 295303 | ||||
| * | [clang-tidy] Add support for NOLINTNEXTLINE. | Benjamin Kramer | 2017-02-14 | 1 | -0/+29 |
| | | | | | | | | | | | Reviewers: alexfh Subscribers: JDevlieghere, cfe-commits Differential Revision: https://reviews.llvm.org/D29899 llvm-svn: 295049 | ||||
| * | [clang-tidy] Reduce indentation. NFC. | Benjamin Kramer | 2017-02-13 | 1 | -10/+10 |
| | | | | | llvm-svn: 294974 | ||||
| * | [clang-tidy] Add check name to YAML export (clang-tools-extra part) | Alexander Kornienko | 2017-01-03 | 1 | -33/+19 |
| | | | | | | | | | | | | | Add a field indicating the associated check for every replacement to the YAML report generated with the '-export-fixes' option. Update clang-apply-replacements to handle the new format. Patch by Alpha Abdoulaye! Differential revision: https://reviews.llvm.org/D26137 llvm-svn: 290893 | ||||
| * | [clang-tools-extra] Format sources with clang-format. NFC. | Mandeep Singh Grang | 2016-11-08 | 1 | -9/+8 |
| | | | | | | | | | | | | | | | | | Summary: Ran clang-format on all .c/.cpp/.h files in clang-tools-extra. Excluded the test, unittests, clang-reorder-fields, include-fixer, modularize and pptrace directories. Reviewers: klimek, alexfh Subscribers: nemanjai Tags: #clang-tools-extra Differential Revision: https://reviews.llvm.org/D26329 llvm-svn: 286221 | ||||
| * | [clang-tidy] Suppress notes for warnings that were ignored | Malcolm Parsons | 2016-11-02 | 1 | -1/+8 |
| | | | | | | | | | Fixes PR30565. Patch by Nikita Kakuev llvm-svn: 285861 | ||||
| * | [clang-tidy] Clean up code after applying replacements. | Alexander Kornienko | 2016-10-17 | 1 | -2/+3 |
| | | | | | | | | | | | | | | | | Summary: Remove empty namespaces and initializer list commas / colons in affected ranges. Initial patch: proper options for enabling the cleanup and specifying the format style are needed. Reviewers: hokein, ioeric Subscribers: beanz, mgorny, cfe-commits Differential Revision: https://reviews.llvm.org/D24572 llvm-svn: 284399 | ||||
| * | [clang-tidy] fix for NOLINT after macro expansion | Matthias Gehre | 2016-09-24 | 1 | -1/+13 |
| | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: When having ``` c++ #define MACRO code-with-warning MACRO; // NOLINT ``` clang-tidy would still show the warning, because it searched for "NOLINT" only in the first line, not on the second. This caused e.g. https://llvm.org/bugs/show_bug.cgi?id=29089 (where the macro was defined in a system header). See also the added test cases. Now clang-tidy looks at the line of macro invocation and every line of macro definition for a NOLINT comment. Reviewers: alexfh, aaron.ballman, hokein Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D24845 llvm-svn: 282330 | ||||
| * | Fix clang-tidy crash when a single fix is applied on multiple files. | Eric Liu | 2016-08-09 | 1 | -15/+19 |
| | | | | | | | | | | | | | | | | Summary: tooling::Replacements only holds replacements for a single file, so this patch makes Fix a map from file paths to tooling::Replacements so that it can be applied on multiple files. Reviewers: hokein, alexfh Subscribers: Prazek, cfe-commits Differential Revision: https://reviews.llvm.org/D23257 llvm-svn: 278101 | ||||
| * | Changes related to new implementation of tooling::Replacements as class. | Eric Liu | 2016-08-01 | 1 | -1/+8 |
| | | | | | | | | | | | | | Summary: See http://reviews.llvm.org/D21748 for details. Reviewers: djasper, klimek Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D21749 llvm-svn: 277336 | ||||
| * | [Typo police] s/proccess/process/, s/auxiliary/auxilliary/. | Justin Lebar | 2016-07-29 | 1 | -5/+5 |
| | | | | | llvm-svn: 277113 | ||||
| * | [clang-tidy] Avoid duplicated DenseMap lookup. | Benjamin Kramer | 2016-07-21 | 1 | -2/+1 |
| | | | | | | | | The std::string is still constructed on demand. No functionality change intended. llvm-svn: 276282 | ||||
| * | [clang-tidy] Switch to a more common way of customizing check behavior. | Alexander Kornienko | 2016-05-20 | 1 | -4/+0 |
| | | | | | | | | This should have been done this way from the start, however I somehow missed r257177. llvm-svn: 270215 | ||||
| * | [clang-tidy] Apply NOLINT filtering to Clang warnings. | Alexander Kornienko | 2016-05-04 | 1 | -14/+23 |
| | | | | | llvm-svn: 268555 | ||||
| * | [clang-tidy] Fix a crash issue when clang-tidy runs with compilation database. | Haojian Wu | 2016-02-26 | 1 | -3/+5 |
| | | | | | | | | | | | | | | | | | | | | | | Summary: The clang-tidy will trigger an assertion if it's not in the building directory. TEST: cd <llvm-repo>/ ./build/bin/clang-tidy --checks=-*,modernize-use-nullptr -p build tools/clang/tools/extra/clang-tidy/ClangTidy.cpp The crash issue is gone after applying this patch. Fixes PR24834, PR26241 Reviewers: bkramer, alexfh Subscribers: rizsotto.mailinglist, cfe-commits Differential Revision: http://reviews.llvm.org/D17335 llvm-svn: 261991 | ||||
| * | Add a new check, readability-redundant-string-init, that checks unnecessary ↵ | Alexander Kornienko | 2016-02-25 | 1 | -3/+2 |
| | | | | | | | | | | | | | | | string initializations. Reviewers: hokein, alexfh Subscribers: cfe-commits Patch by Shuai Wang! Differential Revision: http://reviews.llvm.org/D17586 llvm-svn: 261939 | ||||
| * | [clang-tidy] Fix a copy-paste error. | Alexander Kornienko | 2016-01-15 | 1 | -1/+1 |
| | | | | | llvm-svn: 257900 | ||||
| * | Teach clang-tidy how to upgrade warnings into errors. | Jonathan Roelofs | 2016-01-13 | 1 | -3/+14 |
| | | | | | | | | | | 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 | ||||
| * | Disable part of the misc-move-constructor-init checker when the check is ↵ | Aaron Ballman | 2016-01-08 | 1 | -0/+4 |
| | | | | | | | 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 | ||||
| * | [clang-tidy] Test commit (playing with git-svn) | Alexander Kornienko | 2015-11-16 | 1 | -1/+1 |
| | | | | | llvm-svn: 253203 | ||||
| * | Add ExtraArgs and ExtraArgsBefore options to enable clang warnings via ↵ | Alexander Kornienko | 2015-11-09 | 1 | -3/+8 |
| | | | | | | | | | | | | | | | configuration files. Summary: This patch depends on http://reviews.llvm.org/D14191 Reviewers: djasper, klimek Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D14192 llvm-svn: 252485 | ||||
| * | Replacements in different files do not overlap. | Angel Garcia Gomez | 2015-10-16 | 1 | -16/+22 |
| | | | | | | | | | | | | | Summary: Prevent clang-tidy from discarding fixes that are in different files but happen to have the same file offset. Reviewers: klimek, bkramer Subscribers: bkramer, alexfh, cfe-commits Differential Revision: http://reviews.llvm.org/D13810 llvm-svn: 250523 | ||||
| * | Empty undefined static variable -> local variable. | Benjamin Kramer | 2015-10-16 | 1 | -1/+1 |
| | | | | | | | Resolves a -Wundefined-internal warning from clang. llvm-svn: 250510 | ||||
| * | Fix overlapping replacements in clang-tidy. | Angel Garcia Gomez | 2015-10-16 | 1 | -25/+143 |
| | | | | | | | | | | | | | Summary: Prevent clang-tidy from applying fixes to errors that overlap with other errors' fixes, with one exception: if one fix is completely contained inside another one, then we can apply the big one. Reviewers: bkramer, klimek Subscribers: djasper, cfe-commits, alexfh Differential Revision: http://reviews.llvm.org/D13516 llvm-svn: 250509 | ||||
| * | [clang-tidy] Ignore spaces in -checks= | Alexander Kornienko | 2015-09-16 | 1 | -1/+1 |
| | | | | | llvm-svn: 247812 | ||||
| * | Test commit. | Marek Kurdej | 2015-09-14 | 1 | -2/+1 |
| | | | | | llvm-svn: 247536 | ||||
| * | Reapplying r246209, which exposed language options to the checkers. This ↵ | Aaron Ballman | 2015-08-28 | 1 | -0/+1 |
| | | | | | | | time disable UseNullptrCheck when not compiling in C++ mode, but still allow in C++11 mode since it's likely the user wishes to modernize their code. llvm-svn: 246298 | ||||
| * | Reverting r246209 while I investigate a build bot failure: ↵ | Aaron Ballman | 2015-08-27 | 1 | -1/+0 |
| | | | | | | | http://lab.llvm.org:8011/builders/clang-x86_64-debian-fast/builds/30516 llvm-svn: 246224 | ||||
| * | Expose language options to the checkers; disable UseNullptrCheck when not ↵ | Aaron Ballman | 2015-08-27 | 1 | -0/+1 |
| | | | | | | | compiling in C++11 mode. llvm-svn: 246209 | ||||
| * | Lazily initialize HeaderFilter in ClangTidyDiagnosticConsumer. This | Daniel Jasper | 2015-08-12 | 1 | -10/+8 |
| | | | | | | | | | | 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 | ||||
| * | [clang-tidy] Count errors in ClangTidyDiagnosticConsumer | Alexander Kornienko | 2014-11-20 | 1 | -0/+3 |
| | | | | | | | | This re-applies r222363 reverted in r222390 after compilation errors in our out-of-tree clang-tidy tests were fixed. llvm-svn: 222427 | ||||
| * | Revert r222363: "[clang-tidy] Count errors in ClangTidyDiagnosticConsumer" | Hans Wennborg | 2014-11-19 | 1 | -3/+0 |
| | | | | | | | | This was causing clang-tidy invocations that would previously pass despite source errors to fail. llvm-svn: 222390 | ||||
| * | [clang-tidy] Count errors in ClangTidyDiagnosticConsumer | Alexander Kornienko | 2014-11-19 | 1 | -0/+3 |
| | | | | | llvm-svn: 222363 | ||||
| * | [clang-tidy] Added -system-headers option. | Alexander Kornienko | 2014-10-28 | 1 | -1/+2 |
| | | | | | | | | Added -system-headers option to allow display of warnings from system headers. This is needed for testing libcxx, for example. llvm-svn: 220826 | ||||
| * | Add flag --enable-check-profile to clang-tidy. | Samuel Benzaquen | 2014-10-23 | 1 | -1/+6 |
| | | | | | | | | | | | | | | | | Summary: Add flag --enable-check-profile to clang-tidy. It turns on per-matcher profiles in MatchFinder and prints a report to stderr at the end. Reviewers: alexfh Subscribers: curdeius, cfe-commits Differential Revision: http://reviews.llvm.org/D5937 llvm-svn: 220491 | ||||
| * | Implemented clang-tidy configurability via .clang-tidy files. | Alexander Kornienko | 2014-09-04 | 1 | -5/+9 |
| | | | | | | | | | | | | | | | | | | Summary: This adds a support for the .clang-tidy file reading using FileOptionsProvider, -dump-config option, and changes tests to not depend on default checks set. Reviewers: klimek, bkramer, djasper Reviewed By: djasper Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D5186 llvm-svn: 217155 | ||||
| * | Rename ChecksFilter to GlobList, as there's nothing specific to checks in it. | Alexander Kornienko | 2014-08-06 | 1 | -15/+15 |
| | | | | | | | | | | | | | | | | | | | Summary: Rename ChecksFilter to GlobList, as there's nothing specific to checks in it. It's a rather generic way to represent sets of strings (or patterns), so it may be used for something else in ClangTidy. The new name would not look strange when used to filter other entities. Reviewers: klimek Reviewed By: klimek Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D4806 llvm-svn: 214961 | ||||

