blob: 59c63893a63407a38c8bf8d56bb44a288c3d94fd [file] [log] [blame]
Aaron Ballmand3d78b92017-11-28 21:09:25 +00001//===--- 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 Hockett587deb42018-01-19 23:59:59 +000014#include "MultipleInheritanceCheck.h"
Julie Hocketta966f452017-12-22 16:52:25 +000015#include "OverloadedOperatorCheck.h"
Julie Hockett1ee1f492018-01-11 21:17:43 +000016#include "StaticallyConstructedObjectsCheck.h"
Julie Hockett93a88e32018-01-17 21:18:15 +000017#include "TrailingReturnCheck.h"
Julie Hockett63b57db2017-12-15 18:54:28 +000018#include "VirtualInheritanceCheck.h"
Aaron Ballmand3d78b92017-11-28 21:09:25 +000019
20using namespace clang::ast_matchers;
21
22namespace clang {
23namespace tidy {
24namespace fuchsia {
25
Julie Hocketta0d50ce2017-12-05 18:50:49 +000026/// This module is for Fuchsia-specific checks.
Aaron Ballmand3d78b92017-11-28 21:09:25 +000027class FuchsiaModule : public ClangTidyModule {
28public:
29 void addCheckFactories(ClangTidyCheckFactories &CheckFactories) override {
30 CheckFactories.registerCheck<DefaultArgumentsCheck>(
31 "fuchsia-default-arguments");
Julie Hockett587deb42018-01-19 23:59:59 +000032 CheckFactories.registerCheck<MultipleInheritanceCheck>(
33 "fuchsia-multiple-inheritance");
Julie Hocketta966f452017-12-22 16:52:25 +000034 CheckFactories.registerCheck<OverloadedOperatorCheck>(
35 "fuchsia-overloaded-operator");
Julie Hockett1ee1f492018-01-11 21:17:43 +000036 CheckFactories.registerCheck<StaticallyConstructedObjectsCheck>(
37 "fuchsia-statically-constructed-objects");
Julie Hockett93a88e32018-01-17 21:18:15 +000038 CheckFactories.registerCheck<TrailingReturnCheck>(
39 "fuchsia-trailing-return");
Julie Hockett63b57db2017-12-15 18:54:28 +000040 CheckFactories.registerCheck<VirtualInheritanceCheck>(
41 "fuchsia-virtual-inheritance");
Aaron Ballmand3d78b92017-11-28 21:09:25 +000042 }
43};
44// Register the FuchsiaTidyModule using this statically initialized variable.
45static ClangTidyModuleRegistry::Add<FuchsiaModule>
46 X("fuchsia-module", "Adds Fuchsia platform checks.");
47} // namespace fuchsia
48
49// This anchor is used to force the linker to link in the generated object file
50// and thus register the FuchsiaModule.
51volatile int FuchsiaModuleAnchorSource = 0;
52
53} // namespace tidy
54} // namespace clang