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" |
| 14 | |
| 15 | using namespace clang::ast_matchers; |
| 16 | |
| 17 | namespace clang { |
| 18 | namespace tidy { |
| 19 | namespace fuchsia { |
| 20 | |
Julie Hockett | a0d50ce | 2017-12-05 18:50:49 +0000 | [diff] [blame^] | 21 | /// This module is for Fuchsia-specific checks. |
Aaron Ballman | d3d78b9 | 2017-11-28 21:09:25 +0000 | [diff] [blame] | 22 | class FuchsiaModule : public ClangTidyModule { |
| 23 | public: |
| 24 | void addCheckFactories(ClangTidyCheckFactories &CheckFactories) override { |
| 25 | CheckFactories.registerCheck<DefaultArgumentsCheck>( |
| 26 | "fuchsia-default-arguments"); |
| 27 | } |
| 28 | }; |
| 29 | // Register the FuchsiaTidyModule using this statically initialized variable. |
| 30 | static ClangTidyModuleRegistry::Add<FuchsiaModule> |
| 31 | X("fuchsia-module", "Adds Fuchsia platform checks."); |
| 32 | } // namespace fuchsia |
| 33 | |
| 34 | // This anchor is used to force the linker to link in the generated object file |
| 35 | // and thus register the FuchsiaModule. |
| 36 | volatile int FuchsiaModuleAnchorSource = 0; |
| 37 | |
| 38 | } // namespace tidy |
| 39 | } // namespace clang |