summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* MPITypeMismatchCheck for Clang-TidyAlexander Kornienko2016-07-251-0/+5
| | | | | | | | | | | | | | | | | | | | | | Summary: This check verifies if buffer type and MPI (Message Passing Interface) datatype pairs match. All MPI datatypes defined by the MPI standard (3.1) are verified by this check. User defined typedefs, custom MPI datatypes and null pointer constants are skipped, in the course of verification. Instructions on how to apply the check can be found at: https://github.com/0ax1/MPI-Checker/tree/master/examples Reviewers: alexfh Subscribers: cfe-commits Projects: #clang-tools-extra Patch by Alexander Droste! Differential Revision: https://reviews.llvm.org/D21962 llvm-svn: 276640
* [clang-tidy] Pass absolute path to OptionsProvider::getOptions/getRawOptions.Haojian Wu2016-07-111-2/+8
| | | | | | | | | | | | | | | Summary: Although there is no guarantee of getOptions/getRawOptions receiving an absolute path, we try to make it if possible. So FileOptionProvider subclasses don't have to convert the path to an absolute path. Reviewers: alexfh Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D22154 llvm-svn: 275051
* Apply performance-unnecessary-value-param to clang-tidy.Benjamin Kramer2016-06-151-1/+1
| | | | | | With minor manual tweaks. No functionality change intended. llvm-svn: 272795
* Add boost-use-to-stringPiotr Padlewski2016-04-291-0/+5
| | | | | | http://reviews.llvm.org/D18136 llvm-svn: 268079
* clang-tidy -list-checks should exit with non-zero code when no checks are ↵Alexander Kornienko2016-04-271-0/+4
| | | | | | enabled. llvm-svn: 267697
* [ClangTidy] Add an 'explain-checks' option to diagnose where each checks ↵Haojian Wu2016-04-271-5/+26
| | | | | | | | | | | | comes from. Reviewers: alexfh Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D18694 llvm-svn: 267683
* [clang-tidy] Reformatted docs + minor updatesAlexander Kornienko2016-02-081-115/+138
| | | | llvm-svn: 260065
* Teach clang-tidy how to upgrade warnings into errors.Jonathan Roelofs2016-01-131-10/+28
| | | | | | | | | 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] Add UnnecessaryCopyInitialization check to new "performance" ↵Alexander Kornienko2015-12-301-0/+5
| | | | | | | | | | | | | | | | | | | module in ClangTidy Summary: The patch adds a new ClangTidy check that detects when expensive-to-copy types are unnecessarily copy initialized from a const reference that has the same or are larger scope than the copy. It currently only detects this when the copied variable is const qualified. But this will be extended to non const variables if they are only used in a const fashion. Reviewers: alexfh Subscribers: cfe-commits Patch by Felix Berger! Differential Revision: http://reviews.llvm.org/D15623 llvm-svn: 256632
* Add a new module for the C++ Core Guidelines, and the first checker for ↵Aaron Ballman2015-10-061-0/+5
| | | | | | | | those guidelines: cppcoreguidelines-pro-type-reinterpret-cast. Patch by Matthias Gehre! llvm-svn: 249399
* Adding a new clang-tidy module to house CERT-specific checkers, and map ↵Aaron Ballman2015-10-021-0/+5
| | | | | | existing checkers to CERT secure coding rules and recommendations for both C (https://www.securecoding.cert.org/confluence/display/c/SEI+CERT+C+Coding+Standard) and C++ (https://www.securecoding.cert.org/confluence/pages/viewpage.action?pageId=637). llvm-svn: 249130
* [clang-tidy] Improve the help text for -dump-config.Alexander Kornienko2015-09-161-2/+4
| | | | llvm-svn: 247792
* [clang-tidy] Fix LoopConvertCheck bug.Alexander Kornienko2015-08-191-5/+10
| | | | | | | | | | | | Fix LoopConvertCheck bug: StringRef to temporaries. Also add LLVM_ATTRIBUTE_UNUSED to ModernizeModuleAnchorDestination. http://reviews.llvm.org/D12157 Patch by Angel Garcia! llvm-svn: 245458
* [clang-tidy] Fix a use-after-free.Alexander Kornienko2015-08-171-1/+1
| | | | llvm-svn: 245215
* [clang-tidy] Allow use of -list-checks option without need to pass source files.Alexander Kornienko2015-08-171-6/+17
| | | | | | | | | | | | Initialize CommonOptionsParser with ZeroOrOne NumOccurrenceFlag so callers can pass -list-checks without the need to pass additional positional parameters, then add dummy file if none were supplied. http://reviews.llvm.org/D12070 Patch by Don Hinton! llvm-svn: 245205
* [clang-tidy] Create clang-tidy module modernize. Add pass-by-value check.Alexander Kornienko2015-08-141-0/+4
| | | | | | | | | | This is the first step for migrating cppmodernize to clang-tidy. http://reviews.llvm.org/D11946 Patch by Angel Garcia! llvm-svn: 245045
* Silence gcc 5.1 unused variable warnings using LLVM_ATTRIBUTE_UNUSED.Yaron Keren2015-08-071-4/+4
| | | | llvm-svn: 244329
* Updating the documentation for clang-tidy. Removes some non-ASCII characters ↵Aaron Ballman2015-07-271-2/+2
| | | | | | from the documentation, and removes shell-specific single quote characters as they cause issues for some shells (such as on Windows). llvm-svn: 243266
* Make helpers static. clang-tools edition.Benjamin Kramer2015-03-231-2/+2
| | | | | | Also purge dead code found by it. NFC. llvm-svn: 232948
* [clang-tidy] Fix a typo.Alexander Kornienko2014-12-091-2/+3
| | | | llvm-svn: 223777
* [clang-tidy] Update help messages and docs.Alexander Kornienko2014-12-031-6/+21
| | | | | | Fixed incorrect examples of configuration, clarified the usage of -dump-config. llvm-svn: 223235
* [clang-tidy] Added -fix-errors optionAlexander Kornienko2014-11-031-4/+26
| | | | | | | | | | | | | | | | | | Summary: Added -fix-errors option to allow applying fixes when compiler errors are present. Without this flag -fix would bail out if there are compiler errors. This is needed to avoid applying wrong fixes if Clang fails to recover from compilation errors correctly. Reviewers: djasper, klimek Reviewed By: klimek Subscribers: curdeius, cfe-commits Differential Revision: http://reviews.llvm.org/D6059 llvm-svn: 221152
* Shrink the set of checks enabled by default.Alexander Kornienko2014-10-291-5/+4
| | | | | | | | | | | | | | | | Summary: Enable only compiler diagnostics and safe static analyzer checks by default. Let the defaults be conservative and safe for an average project. Reviewers: djasper Reviewed By: djasper Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D6027 llvm-svn: 220865
* [clang-tidy] Added -system-headers option.Alexander Kornienko2014-10-281-0/+7
| | | | | | | Added -system-headers option to allow display of warnings from system headers. This is needed for testing libcxx, for example. llvm-svn: 220826
* [clang-tidy] Bring order to check registration.Alexander Kornienko2014-10-261-0/+4
| | | | | | | | | | | | | | | | Summary: Register readability checks in a separate module. Renamed the checks and test file names accordingly. Reviewers: djasper, klimek Reviewed By: klimek Subscribers: curdeius, cfe-commits Differential Revision: http://reviews.llvm.org/D5936 llvm-svn: 220631
* Add flag --enable-check-profile to clang-tidy.Samuel Benzaquen2014-10-231-1/+51
| | | | | | | | | | | | | | | 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
* Fix a typoAlexander Kornienko2014-09-261-1/+1
| | | | llvm-svn: 218512
* [clang-tidy] Add a -config={YAML} option.Alexander Kornienko2014-09-261-6/+35
| | | | | | | | | | | | | | | | Summary: Add -config option to allow specifying configuration in YAML/JSON format on the command line. Reviewers: klimek Reviewed By: klimek Subscribers: curdeius, cfe-commits Differential Revision: http://reviews.llvm.org/D5501 llvm-svn: 218511
* Provide user name in ClangTidyOptions.Alexander Kornienko2014-09-241-5/+10
| | | | | | | | | | | | | | | | | | | Summary: This adds the ClangTidyOptions::User field and fills it from the USER or the USERNAME environment variable, if possible. The FileOptionsProvider now takes "default" options instead of "fallback" options, as it now uses these when an option is not set in the configuration file (one exception is the checks list). Reviewers: bkramer, klimek Reviewed By: klimek Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D5440 llvm-svn: 218402
* Implemented clang-tidy-check-specific options.Alexander Kornienko2014-09-121-0/+1
| | | | | | | | | | | | | | | | | Summary: Each check can implement readOptions and storeOptions methods to read and store custom options. Each check's options are stored in a local namespace to avoid name collisions and provide some sort of context to the user. Reviewers: bkramer, klimek Reviewed By: klimek Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D5296 llvm-svn: 217661
* Moved main() to the clang::tidy namespace, no functional changes.Alexander Kornienko2014-09-101-22/+24
| | | | llvm-svn: 217493
* Don't write files with no fixes.Alexander Kornienko2014-09-041-1/+1
| | | | llvm-svn: 217163
* Implemented clang-tidy configurability via .clang-tidy files.Alexander Kornienko2014-09-041-15/+51
| | | | | | | | | | | | | | | | | 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
* [clang-tidy] Add an option to export suggested fixes into a file.Benjamin Kramer2014-09-041-0/+17
| | | | | | | | Allows gathering fixes and applying them with clang-apply-fixes. Differential Revision: http://reviews.llvm.org/D5176 llvm-svn: 217139
* Replace llvm::error_code with std::error_code.Rafael Espindola2014-06-121-1/+1
| | | | llvm-svn: 210776
* Allow per-file clang-tidy options.Alexander Kornienko2014-06-051-8/+13
| | | | | | | | | | | | | | | | | | Summary: This patch makes it possible for clang-tidy clients to provide different options for different translation units. The option, which doesn't make sense to be file-dependent, was moved to a separate ClangTidyGlobalOptions struct. Added parsing of ClangTidyOptions. Reviewers: klimek Reviewed By: klimek Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D3979 llvm-svn: 210260
* Exit with error when no checks enabled.Alexander Kornienko2014-06-021-1/+9
| | | | | | | | | | | | | | | | Summary: This seems like a more appropriate reaction to the user specifying a single check with a wrong name, for example. Reviewers: klimek Reviewed By: klimek Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D3981 llvm-svn: 210043
* Add clang-tidy -line-filter option to filter findings by line ranges.Alexander Kornienko2014-05-221-8/+32
| | | | | | | | | | | | | | | | | Summary: This is going to be used for a clang-tidy-diff script to display warnings in changed lines only. The option uses JSON, as its value is not intended to be entered manually. Reviewers: klimek Reviewed By: klimek Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D3873 llvm-svn: 209450
* Improved llvm-namespace-comment check.Alexander Kornienko2014-05-191-1/+0
| | | | | | | | | | | | | | | | | | | Summary: Handle various forms of existing namespace closing comments, fix existing comments with wrong namespace name, ignore short namespaces. The state of this check now seems to be enough to enable it by default to gather user feedback ;) Reviewers: klimek Reviewed By: klimek Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D3825 llvm-svn: 209141
* Update clang-tidy documentation.Alexander Kornienko2014-05-161-19/+24
| | | | | | | | | | | | | | | | Summary: Updated the help message, updated description of -checks=, removed mentions of -disable-checks. Reviewers: klimek Reviewed By: klimek Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D3793 llvm-svn: 208979
* Change the behavior of clang-tidy -checks=, remove -disable-checks.Alexander Kornienko2014-05-151-14/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Make checks filtering more intuitive and easy to use. Remove -disable-checks and change the format of -checks= to a comma-separated list of globs with optional '-' prefix to denote exclusion. The -checks= option is now cumulative, so it modifies defaults, not overrides them. Each glob adds or removes to the current set of checks, so the filter can be refined or overriden by adding globs. Example: The default value for -checks= is '*,-clang-analyzer-alpha*,-llvm-include-order,-llvm-namespace-comment,-google-*', which allows all checks except for the ones named clang-analyzer-alpha* and others specified with the leading '-'. To allow all google-* checks one can write: clang-tidy -checks=google-* ... If one needs only google-* checks, we first need to remove everything (-*): clang-tidy -checks=-*,google-* etc. I'm not sure if we need to change something here, so I didn't touch the docs yet. Reviewers: klimek, alexfh Reviewed By: alexfh Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D3770 llvm-svn: 208883
* Store Errors inside ClangTidyContext instead of just pointer to an externalAlexander Kornienko2014-05-091-1/+1
| | | | | | | | | | | | | | | array. This simplifies usage of ClangTidyContext a bit and seems to be more consistent. Reviewers: klimek Reviewed By: klimek Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D3685 llvm-svn: 208407
* Print stats on displayed and ignored warnings.Alexander Kornienko2014-05-071-2/+29
| | | | | | | | | | | | | | | | Summary: Also displays a hint to use -header-filter='.*' in case any warnings are in non-user code. This will help discoverability of this option. Reviewers: klimek Reviewed By: klimek Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D3621 llvm-svn: 208174
* Add clang-tidy -header-filter optionAlexander Kornienko2014-05-051-0/+7
| | | | | | | | | | | | | | | | | | Summary: Add clang-tidy -header-filter option to specify from which headers we want diagnostics to be printed. By default we don't print diagnostics from headers. We always print diagnostics from the main file of each translation unit. Reviewers: djasper, klimek Reviewed By: klimek Subscribers: klimek, cfe-commits Differential Revision: http://reviews.llvm.org/D3590 llvm-svn: 207970
* Add a clang-tidy flag to support temporary destructor-aware analysis ↵Alex McCarthy2014-04-301-0/+8
| | | | | | | | | | | | (workaround for bug 15599). Reviewers: alexfh Subscribers: jordan_rose, klimek, djasper, cfe-commits Differential Revision: http://reviews.llvm.org/D3556 llvm-svn: 207652
* Add ClangTidyOptions to encapsulate all clang-tidy options.Alexander Kornienko2014-04-291-3/+6
| | | | | | | | | | | | Reviewers: djasper Reviewed By: djasper Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D3544 llvm-svn: 207532
* Fix typo (first commit to test commit access).Alex McCarthy2014-04-291-1/+1
| | | | llvm-svn: 207490
* Fix regex bug in clang-tidy.Daniel Jasper2014-04-021-1/+1
| | | | | | | | Also make tests slightly less dependent on default flags. Once we have implemented configuration file support, we might want to store the clang-tidy configuration for the tests there. llvm-svn: 205408
* Disable a few clang-tidy checks by default.Daniel Jasper2014-04-021-1/+5
| | | | | | | | The goal is to be able to run clang-tidy on LLVM files without further configuration for now. Once llvm.org/PR19306 is addressed, we can add a configuration file instead and choose other defaults. llvm-svn: 205407
* Added a module for checks not related to LLVM or Google coding style.Alexander Kornienko2014-03-051-4/+6
| | | | llvm-svn: 202970
OpenPOWER on IntegriCloud