summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clang-tidy/plugin/ClangTidyPlugin.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [clang-tools-extra] Migrate llvm::make_unique to std::make_uniqueJonas Devlieghere2019-08-141-4/+4
| | | | | | | | | | Now that we've moved to C++14, we no longer need the llvm::make_unique implementation from STLExtras.h. This patch is a mechanical replacement of (hopefully) all the llvm::make_unique instances across the monorepo. Differential revision: https://reviews.llvm.org/D66259 llvm-svn: 368944
* [clang-tidy] Make the plugin honor NOLINTNikolai Kosjar2019-06-061-6/+17
| | | | | | | | | | | | | | | | | Instantiate a ClangTidyDiagnosticConsumer also for the plugin case and let it forward the diagnostics to the external diagnostic engine that is already in place. One minor difference to the clang-tidy executable case is that the compiler checks/diagnostics are referred to with their original name. For example, for -Wunused-variable the plugin will refer to the check as "-Wunused-variable" while the clang-tidy executable will refer to that as "clang-diagnostic- unused-variable". This is because the compiler diagnostics never reach ClangTidyDiagnosticConsumer. Differential Revision: https://reviews.llvm.org/D61487 llvm-svn: 362702
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-4/+3
| | | | | | | | | | | | | | | | | to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636
* [clang-tidy] Remove extra config.h includesIvan Donchevskii2018-12-141-1/+0
| | | | | | | | | It's included in a new header ClangTidyForceLinker.h and should not be included the second time. Follow up for the https://reviews.llvm.org/D55595 llvm-svn: 349132
* [clang-tidy] Share the forced linking code between clang-tidy tool and pluginIvan Donchevskii2018-12-141-93/+1
| | | | | | | | | Extract code that forces linking to the separate header and include it in both plugin and standalone tool. Try 2: missing header guard and "clang/Config/config.h" are added to the new header. Differential Revision: https://reviews.llvm.org/D55595 llvm-svn: 349131
* Revert "[clang-tidy] Share the forced linking code between clang-tidy tool ↵Douglas Yung2018-12-141-1/+93
| | | | | | | | | | | and plugin" This reverts commit r349038 as it was causing test failures: http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast/builds/22185 http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast/builds/40886 llvm-svn: 349121
* [clang-tidy] Share the forced linking code between clang-tidy tool and pluginIvan Donchevskii2018-12-131-93/+1
| | | | | | | | Extract code that forces linking to the separate header and include it in both plugin and standalone tool Differential Revision: https://reviews.llvm.org/D55595 llvm-svn: 349038
* [clang-tidy] Untangle layering in ClangTidyDiagnosticConsumer somewhat. NFCSam McCall2018-11-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | Summary: Clang's hierarchy is CompilerInstance -> DiagnosticsEngine -> DiagnosticConsumer. (Ownership is optional/shared, but this structure is fairly clear). Currently ClangTidyDiagnosticConsumer *owns* the DiagnosticsEngine: - this inverts the hierarchy, which is confusing - this means ClangTidyDiagnosticConsumer() mutates the passed-in context, which is both surprising and limits flexibility - it's not possible to use a different DiagnosticsEngine with ClangTidy This means a little bit more code in the places ClangTidy is used standalone, but more flexibility in using ClangTidy with other diagnostics configurations. Reviewers: hokein Subscribers: xazax.hun, cfe-commits Differential Revision: https://reviews.llvm.org/D54033 llvm-svn: 346418
* [clang-tidy] Remove false decoupling in ClangTidyContext. NFCSam McCall2018-10-311-1/+1
| | | | | | | These getters/setters don't encapsulate any behavior, and can only be called by friends. llvm-svn: 345716
* [clang-tidy] Build it even without static analyzerStephen Kelly2018-10-011-0/+3
| | | | | | | | | | | | | | | | | | | | | | Conditionally compile the parts of clang-tidy which depend on the static analyzer. Funnily enough, I made the patch to exclude this from the build in 2013, and it was committed with the comment that the tool should not be fully excluded, but only the parts of it which depend on the analyzer should be excluded. http://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-20130617/081797.html This commit implements that idea. Reviewed By: aaron.ballman Tags: #clang-tools-extra Differential Revision: https://reviews.llvm.org/D52334 llvm-svn: 343528
* Reverting r343415 as it breaks at least one of the bots.Aaron Ballman2018-09-301-2/+0
| | | | | | http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast/builds/37336 llvm-svn: 343418
* Allow clang-tidy to be built without a dependency on the clang static analyzer.Aaron Ballman2018-09-301-0/+2
| | | | | | Patch by Stephen Kelly. llvm-svn: 343415
* [clang-tidy] add all clang-tidy modules to pluginJonas Toth2018-07-311-10/+40
| | | | | | | | | | | | | | | | Summary: This patch addresses PR38359 and adds all existing clang-tidy modules to the plugin that can be used together with libclang. Reviewers: alexfh, aaron.ballman, hokein, ilya-biryukov Reviewed By: alexfh Subscribers: srhines, mgorny, xazax.hun, cfe-commits Differential Revision: https://reviews.llvm.org/D50060 llvm-svn: 338393
* [clang-tidy] Add "portability" module and rename readability-simd-intrinsics ↵Fangrui Song2018-03-071-0/+5
| | | | | | | | | | | | to portability-simd-intrinsics Reviewers: alexfh Subscribers: klimek, nemanjai, mgorny, xazax.hun, kbarton, cfe-commits Differential Revision: https://reviews.llvm.org/D44173 llvm-svn: 326909
* [clang-tidy ObjC] [1/3] New module `objc` for Objective-C checksHaojian Wu2017-10-261-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: This is part 1 of 3 of a series of changes to improve Objective-C linting in clang-tidy. This introduces a new clang-tidy module, `objc`, specifically for Objective-C / Objective-C++ checks. The module is currently empty; D39142 adds the first check. Test Plan: `ninja check-clang-tools` Patch by Ben Hamilton! Reviewers: hokein, alexfh Reviewed By: hokein Subscribers: Wizard, mgorny Differential Revision: https://reviews.llvm.org/D39188 llvm-svn: 316643
* [clang-tidy] fix missing anchor for MPI ModulePiotr Padlewski2016-12-161-0/+5
| | | | | | | | | | | | Summary: MPIModule was not linked to plugins Reviewers: alexfh, Alexander_Droste, hokein Subscribers: JDevlieghere, cfe-commits Differential Revision: https://reviews.llvm.org/D27813 llvm-svn: 289930
* [clang-tidy] Add "clang-tidy as a clang plugin" skeleton.Benjamin Kramer2016-03-031-0/+122
This doesn't really do much at the moment. You can load it via libclang and set the -checks via an extra command line argument as illustrated in the test case. Support for other options (including headers check) is currently missing. Also when using this with libclang some checks may not work with the precompiled preamble in place. This can be used to easily show clang-tidy warnings in an editor integration as all that's needed is adding command line flags that are passed into libclang. Warnings and FixIts are exposed via the existing CXDiagnostic machinery. Differential Revision: http://reviews.llvm.org/D17807 llvm-svn: 262595
OpenPOWER on IntegriCloud