1d9b3d08aSJulie Hockett //===--- FuchsiaTidyModule.cpp - clang-tidy -------------------------------===// 2d3d78b90SAaron Ballman // 32946cd70SChandler Carruth // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 42946cd70SChandler Carruth // See https://llvm.org/LICENSE.txt for license information. 52946cd70SChandler Carruth // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6d3d78b90SAaron Ballman // 7d3d78b90SAaron Ballman //===----------------------------------------------------------------------===// 8d3d78b90SAaron Ballman 9d3d78b90SAaron Ballman #include "../ClangTidy.h" 10d3d78b90SAaron Ballman #include "../ClangTidyModule.h" 11d3d78b90SAaron Ballman #include "../ClangTidyModuleRegistry.h" 128c1ee67cSJulie Hockett #include "../google/UnnamedNamespaceInHeaderCheck.h" 13d9b3d08aSJulie Hockett #include "DefaultArgumentsCallsCheck.h" 14d9b3d08aSJulie Hockett #include "DefaultArgumentsDeclarationsCheck.h" 15587deb45SJulie Hockett #include "MultipleInheritanceCheck.h" 16a966f45bSJulie Hockett #include "OverloadedOperatorCheck.h" 171ee1f493SJulie Hockett #include "StaticallyConstructedObjectsCheck.h" 1893a88e33SJulie Hockett #include "TrailingReturnCheck.h" 1963b57db3SJulie Hockett #include "VirtualInheritanceCheck.h" 20d3d78b90SAaron Ballman 21d3d78b90SAaron Ballman using namespace clang::ast_matchers; 22d3d78b90SAaron Ballman 23*7d2ea6c4SCarlos Galvez namespace clang::tidy { 24d3d78b90SAaron Ballman namespace fuchsia { 25d3d78b90SAaron Ballman 26a0d50ce7SJulie Hockett /// This module is for Fuchsia-specific checks. 27d3d78b90SAaron Ballman class FuchsiaModule : public ClangTidyModule { 28d3d78b90SAaron Ballman public: addCheckFactories(ClangTidyCheckFactories & CheckFactories)29d3d78b90SAaron Ballman void addCheckFactories(ClangTidyCheckFactories &CheckFactories) override { 30d9b3d08aSJulie Hockett CheckFactories.registerCheck<DefaultArgumentsCallsCheck>( 31d9b3d08aSJulie Hockett "fuchsia-default-arguments-calls"); 32d9b3d08aSJulie Hockett CheckFactories.registerCheck<DefaultArgumentsDeclarationsCheck>( 33d9b3d08aSJulie Hockett "fuchsia-default-arguments-declarations"); 348c1ee67cSJulie Hockett CheckFactories.registerCheck<google::build::UnnamedNamespaceInHeaderCheck>( 358c1ee67cSJulie Hockett "fuchsia-header-anon-namespaces"); 36587deb45SJulie Hockett CheckFactories.registerCheck<MultipleInheritanceCheck>( 37587deb45SJulie Hockett "fuchsia-multiple-inheritance"); 38a966f45bSJulie Hockett CheckFactories.registerCheck<OverloadedOperatorCheck>( 39a966f45bSJulie Hockett "fuchsia-overloaded-operator"); 401ee1f493SJulie Hockett CheckFactories.registerCheck<StaticallyConstructedObjectsCheck>( 411ee1f493SJulie Hockett "fuchsia-statically-constructed-objects"); 4293a88e33SJulie Hockett CheckFactories.registerCheck<TrailingReturnCheck>( 4393a88e33SJulie Hockett "fuchsia-trailing-return"); 4463b57db3SJulie Hockett CheckFactories.registerCheck<VirtualInheritanceCheck>( 4563b57db3SJulie Hockett "fuchsia-virtual-inheritance"); 46d3d78b90SAaron Ballman } 47d3d78b90SAaron Ballman }; 48d3d78b90SAaron Ballman // Register the FuchsiaTidyModule using this statically initialized variable. 49d3d78b90SAaron Ballman static ClangTidyModuleRegistry::Add<FuchsiaModule> 50d3d78b90SAaron Ballman X("fuchsia-module", "Adds Fuchsia platform checks."); 51d3d78b90SAaron Ballman } // namespace fuchsia 52d3d78b90SAaron Ballman 53d3d78b90SAaron Ballman // This anchor is used to force the linker to link in the generated object file 54d3d78b90SAaron Ballman // and thus register the FuchsiaModule. 55d3d78b90SAaron Ballman volatile int FuchsiaModuleAnchorSource = 0; 56d3d78b90SAaron Ballman 57*7d2ea6c4SCarlos Galvez } // namespace clang::tidy 58