2019-06-19 02:07:33 +08:00
|
|
|
//===--- FuchsiaTidyModule.cpp - clang-tidy -------------------------------===//
|
2017-11-29 05:09:25 +08:00
|
|
|
//
|
2019-01-19 16:50:56 +08:00
|
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
2017-11-29 05:09:25 +08:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#include "../ClangTidy.h"
|
|
|
|
#include "../ClangTidyModule.h"
|
|
|
|
#include "../ClangTidyModuleRegistry.h"
|
2018-04-11 00:53:51 +08:00
|
|
|
#include "../google/UnnamedNamespaceInHeaderCheck.h"
|
2019-06-19 02:07:33 +08:00
|
|
|
#include "DefaultArgumentsCallsCheck.h"
|
|
|
|
#include "DefaultArgumentsDeclarationsCheck.h"
|
2018-01-20 07:59:59 +08:00
|
|
|
#include "MultipleInheritanceCheck.h"
|
2017-12-23 00:52:25 +08:00
|
|
|
#include "OverloadedOperatorCheck.h"
|
2018-01-12 05:17:43 +08:00
|
|
|
#include "StaticallyConstructedObjectsCheck.h"
|
2018-01-18 05:18:15 +08:00
|
|
|
#include "TrailingReturnCheck.h"
|
2017-12-16 02:54:28 +08:00
|
|
|
#include "VirtualInheritanceCheck.h"
|
2017-11-29 05:09:25 +08:00
|
|
|
|
|
|
|
using namespace clang::ast_matchers;
|
|
|
|
|
|
|
|
namespace clang {
|
|
|
|
namespace tidy {
|
|
|
|
namespace fuchsia {
|
|
|
|
|
2017-12-06 02:50:49 +08:00
|
|
|
/// This module is for Fuchsia-specific checks.
|
2017-11-29 05:09:25 +08:00
|
|
|
class FuchsiaModule : public ClangTidyModule {
|
|
|
|
public:
|
|
|
|
void addCheckFactories(ClangTidyCheckFactories &CheckFactories) override {
|
2019-06-19 02:07:33 +08:00
|
|
|
CheckFactories.registerCheck<DefaultArgumentsCallsCheck>(
|
|
|
|
"fuchsia-default-arguments-calls");
|
|
|
|
CheckFactories.registerCheck<DefaultArgumentsDeclarationsCheck>(
|
|
|
|
"fuchsia-default-arguments-declarations");
|
2018-04-11 00:53:51 +08:00
|
|
|
CheckFactories.registerCheck<google::build::UnnamedNamespaceInHeaderCheck>(
|
|
|
|
"fuchsia-header-anon-namespaces");
|
2018-01-20 07:59:59 +08:00
|
|
|
CheckFactories.registerCheck<MultipleInheritanceCheck>(
|
|
|
|
"fuchsia-multiple-inheritance");
|
2017-12-23 00:52:25 +08:00
|
|
|
CheckFactories.registerCheck<OverloadedOperatorCheck>(
|
|
|
|
"fuchsia-overloaded-operator");
|
2018-01-12 05:17:43 +08:00
|
|
|
CheckFactories.registerCheck<StaticallyConstructedObjectsCheck>(
|
|
|
|
"fuchsia-statically-constructed-objects");
|
2018-01-18 05:18:15 +08:00
|
|
|
CheckFactories.registerCheck<TrailingReturnCheck>(
|
|
|
|
"fuchsia-trailing-return");
|
2017-12-16 02:54:28 +08:00
|
|
|
CheckFactories.registerCheck<VirtualInheritanceCheck>(
|
|
|
|
"fuchsia-virtual-inheritance");
|
2017-11-29 05:09:25 +08:00
|
|
|
}
|
|
|
|
};
|
|
|
|
// Register the FuchsiaTidyModule using this statically initialized variable.
|
|
|
|
static ClangTidyModuleRegistry::Add<FuchsiaModule>
|
|
|
|
X("fuchsia-module", "Adds Fuchsia platform checks.");
|
|
|
|
} // namespace fuchsia
|
|
|
|
|
|
|
|
// This anchor is used to force the linker to link in the generated object file
|
|
|
|
// and thus register the FuchsiaModule.
|
|
|
|
volatile int FuchsiaModuleAnchorSource = 0;
|
|
|
|
|
|
|
|
} // namespace tidy
|
|
|
|
} // namespace clang
|