mirror of
https://github.com/Gericom/teak-llvm.git
synced 2025-06-19 19:45:40 -04:00

Summary: Change the namespace for llvm checkers from 'llvm' to 'llvm_check', and modify add_new_check.py and rename_check.py to support the new namespace. Checker, file, and directory names remain unchanged. Used new version of rename_check.py to make the change in existing llvm checkers, but had to fix LLVMTidyModule.cpp and LLVMModuleTest.cpp by hand. The changes made by rename_check.py are idempotent, so if accidentally run multiple times, it won't do anything. Reviewed By: aaron.ballman Tags: #clang, #clang-tools-extra Differential Revision: https://reviews.llvm.org/D60629 llvm-svn: 360450
47 lines
1.7 KiB
C++
47 lines
1.7 KiB
C++
//===--- LLVMTidyModule.cpp - clang-tidy ----------------------------------===//
|
|
//
|
|
// 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
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#include "../ClangTidy.h"
|
|
#include "../ClangTidyModule.h"
|
|
#include "../ClangTidyModuleRegistry.h"
|
|
#include "../readability/NamespaceCommentCheck.h"
|
|
#include "HeaderGuardCheck.h"
|
|
#include "IncludeOrderCheck.h"
|
|
#include "PreferIsaOrDynCastInConditionalsCheck.h"
|
|
#include "TwineLocalCheck.h"
|
|
|
|
namespace clang {
|
|
namespace tidy {
|
|
namespace llvm_check {
|
|
|
|
class LLVMModule : public ClangTidyModule {
|
|
public:
|
|
void addCheckFactories(ClangTidyCheckFactories &CheckFactories) override {
|
|
CheckFactories.registerCheck<LLVMHeaderGuardCheck>("llvm-header-guard");
|
|
CheckFactories.registerCheck<IncludeOrderCheck>("llvm-include-order");
|
|
CheckFactories.registerCheck<readability::NamespaceCommentCheck>(
|
|
"llvm-namespace-comment");
|
|
CheckFactories.registerCheck<PreferIsaOrDynCastInConditionalsCheck>(
|
|
"llvm-prefer-isa-or-dyn-cast-in-conditionals");
|
|
CheckFactories.registerCheck<TwineLocalCheck>("llvm-twine-local");
|
|
}
|
|
};
|
|
|
|
// Register the LLVMTidyModule using this statically initialized variable.
|
|
static ClangTidyModuleRegistry::Add<LLVMModule> X("llvm-module",
|
|
"Adds LLVM lint checks.");
|
|
|
|
} // namespace llvm_check
|
|
|
|
// This anchor is used to force the linker to link in the generated object file
|
|
// and thus register the LLVMModule.
|
|
volatile int LLVMModuleAnchorSource = 0;
|
|
|
|
} // namespace tidy
|
|
} // namespace clang
|