brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.3 KiB · 30db5e2 Raw
36 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 "../fuchsia/TemporaryObjectsCheck.h"13 14namespace clang::tidy {15namespace zircon {16 17/// This module is for Zircon-specific checks.18class ZirconModule : public ClangTidyModule {19public:20  void addCheckFactories(ClangTidyCheckFactories &CheckFactories) override {21    CheckFactories.registerCheck<fuchsia::TemporaryObjectsCheck>(22        "zircon-temporary-objects");23  }24};25 26// Register the ZirconTidyModule using this statically initialized variable.27static ClangTidyModuleRegistry::Add<ZirconModule>28    X("zircon-module", "Adds Zircon kernel checks (deprecated in LLVM 24).");29} // namespace zircon30 31// This anchor is used to force the linker to link in the generated object file32// and thus register the ZirconModule.33volatile int ZirconModuleAnchorSource = 0; // NOLINT(misc-use-internal-linkage)34 35} // namespace clang::tidy36