brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.4 KiB · c62c43f Raw
61 lines · cpp
1//===----------------------------------------------------------------------===//2//3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.4// See https://llvm.org/LICENSE.txt for license information.5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception6//7//===----------------------------------------------------------------------===//8 9#include "../ClangTidy.h"10#include "../ClangTidyModule.h"11#include "../ClangTidyModuleRegistry.h"12#include "../google/UnnamedNamespaceInHeaderCheck.h"13#include "DefaultArgumentsCallsCheck.h"14#include "DefaultArgumentsDeclarationsCheck.h"15#include "MultipleInheritanceCheck.h"16#include "OverloadedOperatorCheck.h"17#include "StaticallyConstructedObjectsCheck.h"18#include "TemporaryObjectsCheck.h"19#include "TrailingReturnCheck.h"20#include "VirtualInheritanceCheck.h"21 22using namespace clang::ast_matchers;23 24namespace clang::tidy {25namespace fuchsia {26 27/// This module is for Fuchsia-specific checks.28class FuchsiaModule : public ClangTidyModule {29public:30  void addCheckFactories(ClangTidyCheckFactories &CheckFactories) override {31    CheckFactories.registerCheck<DefaultArgumentsCallsCheck>(32        "fuchsia-default-arguments-calls");33    CheckFactories.registerCheck<DefaultArgumentsDeclarationsCheck>(34        "fuchsia-default-arguments-declarations");35    CheckFactories.registerCheck<google::build::UnnamedNamespaceInHeaderCheck>(36        "fuchsia-header-anon-namespaces");37    CheckFactories.registerCheck<MultipleInheritanceCheck>(38        "fuchsia-multiple-inheritance");39    CheckFactories.registerCheck<OverloadedOperatorCheck>(40        "fuchsia-overloaded-operator");41    CheckFactories.registerCheck<StaticallyConstructedObjectsCheck>(42        "fuchsia-statically-constructed-objects");43    CheckFactories.registerCheck<TemporaryObjectsCheck>(44        "fuchsia-temporary-objects");45    CheckFactories.registerCheck<TrailingReturnCheck>(46        "fuchsia-trailing-return");47    CheckFactories.registerCheck<VirtualInheritanceCheck>(48        "fuchsia-virtual-inheritance");49  }50};51// Register the FuchsiaTidyModule using this statically initialized variable.52static ClangTidyModuleRegistry::Add<FuchsiaModule>53    X("fuchsia-module", "Adds Fuchsia platform checks.");54} // namespace fuchsia55 56// This anchor is used to force the linker to link in the generated object file57// and thus register the FuchsiaModule.58volatile int FuchsiaModuleAnchorSource = 0; // NOLINT(misc-use-internal-linkage)59 60} // namespace clang::tidy61