Aaron Ballman | d3d78b9 | 2017-11-28 21:09:25 +0000 | [diff] [blame] | 1 | //===--- FuchsiaTidyModule.cpp - clang-tidy--------------------------------===// |
| 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
| 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
| 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | |
| 10 | #include "../ClangTidy.h" |
| 11 | #include "../ClangTidyModule.h" |
| 12 | #include "../ClangTidyModuleRegistry.h" |
| 13 | #include "DefaultArgumentsCheck.h" |
Julie Hockett | a966f45 | 2017-12-22 16:52:25 +0000 | [diff] [blame] | 14 | #include "OverloadedOperatorCheck.h" |
Julie Hockett | 63b57db | 2017-12-15 18:54:28 +0000 | [diff] [blame] | 15 | #include "VirtualInheritanceCheck.h" |
Aaron Ballman | d3d78b9 | 2017-11-28 21:09:25 +0000 | [diff] [blame] | 16 | |
| 17 | using namespace clang::ast_matchers; |
| 18 | |
| 19 | namespace clang { |
| 20 | namespace tidy { |
| 21 | namespace fuchsia { |
| 22 | |
Julie Hockett | a0d50ce | 2017-12-05 18:50:49 +0000 | [diff] [blame] | 23 | /// This module is for Fuchsia-specific checks. |
Aaron Ballman | d3d78b9 | 2017-11-28 21:09:25 +0000 | [diff] [blame] | 24 | class FuchsiaModule : public ClangTidyModule { |
| 25 | public: |
| 26 | void addCheckFactories(ClangTidyCheckFactories &CheckFactories) override { |
| 27 | CheckFactories.registerCheck<DefaultArgumentsCheck>( |
| 28 | "fuchsia-default-arguments"); |
Julie Hockett | a966f45 | 2017-12-22 16:52:25 +0000 | [diff] [blame] | 29 | CheckFactories.registerCheck<OverloadedOperatorCheck>( |
| 30 | "fuchsia-overloaded-operator"); |
Julie Hockett | 63b57db | 2017-12-15 18:54:28 +0000 | [diff] [blame] | 31 | CheckFactories.registerCheck<VirtualInheritanceCheck>( |
| 32 | "fuchsia-virtual-inheritance"); |
Aaron Ballman | d3d78b9 | 2017-11-28 21:09:25 +0000 | [diff] [blame] | 33 | } |
| 34 | }; |
| 35 | // Register the FuchsiaTidyModule using this statically initialized variable. |
| 36 | static ClangTidyModuleRegistry::Add<FuchsiaModule> |
| 37 | X("fuchsia-module", "Adds Fuchsia platform checks."); |
| 38 | } // namespace fuchsia |
| 39 | |
| 40 | // This anchor is used to force the linker to link in the generated object file |
| 41 | // and thus register the FuchsiaModule. |
| 42 | volatile int FuchsiaModuleAnchorSource = 0; |
| 43 | |
| 44 | } // namespace tidy |
| 45 | } // namespace clang |