clang-tools 22.0.0git
LLVMLibcTidyModule.cpp
Go to the documentation of this file.
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-exception
6//
7//===----------------------------------------------------------------------===//
8
9#include "../ClangTidy.h"
10#include "../ClangTidyModule.h"
15
16namespace clang::tidy {
17namespace llvm_libc {
18namespace {
19
20class LLVMLibcModule : public ClangTidyModule {
21public:
22 void addCheckFactories(ClangTidyCheckFactories &CheckFactories) override {
23 CheckFactories.registerCheck<CalleeNamespaceCheck>(
24 "llvmlibc-callee-namespace");
25 CheckFactories.registerCheck<ImplementationInNamespaceCheck>(
26 "llvmlibc-implementation-in-namespace");
27 CheckFactories.registerCheck<InlineFunctionDeclCheck>(
28 "llvmlibc-inline-function-decl");
29 CheckFactories.registerCheck<RestrictSystemLibcHeadersCheck>(
30 "llvmlibc-restrict-system-libc-headers");
31 }
32};
33
34} // namespace
35
36// Register the LLVMLibcTidyModule using this statically initialized variable.
37static ClangTidyModuleRegistry::Add<LLVMLibcModule>
38 X("llvmlibc-module", "Adds LLVM libc standards checks.");
39
40} // namespace llvm_libc
41
42// This anchor is used to force the linker to link in the generated object file
43// and thus register the LLVMLibcModule.
44// NOLINTNEXTLINE(misc-use-internal-linkage)
46
47} // namespace clang::tidy
static ClangTidyModuleRegistry::Add< LLVMLibcModule > X("llvmlibc-module", "Adds LLVM libc standards checks.")
volatile int LLVMLibcModuleAnchorSource