//===- ClangTidyPlugin.cpp - clang-tidy as a clang plugin -----------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// #include "../ClangTidy.h" #include "../ClangTidyDiagnosticConsumer.h" #include "../ClangTidyForceLinker.h" #include "../ClangTidyModule.h" #include "clang/Frontend/CompilerInstance.h" #include "clang/Frontend/FrontendPluginRegistry.h" #include "clang/Frontend/MultiplexConsumer.h" namespace clang::tidy { /// The core clang tidy plugin action. This just provides the AST consumer and /// command line flag parsing for using clang-tidy as a clang plugin. class ClangTidyPluginAction : public PluginASTAction { … }; } // namespace clang::tidy // This anchor is used to force the linker to link in the generated object file // and thus register the clang-tidy plugin. volatile int ClangTidyPluginAnchorSource = …; static clang::FrontendPluginRegistry::Add<clang::tidy::ClangTidyPluginAction> X("clang-tidy", "clang-tidy");