clang-tools
20.0.0git
llvm-project
clang-tools-extra
clang-tidy
llvm
HeaderGuardCheck.h
Go to the documentation of this file.
1
//===--- HeaderGuardCheck.h - clang-tidy ------------------------*- C++ -*-===//
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
#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_LLVM_HEADERGUARDCHECK_H
10
#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_LLVM_HEADERGUARDCHECK_H
11
12
#include "../utils/HeaderGuard.h"
13
14
namespace
clang::tidy::llvm_check
{
15
16
/// Finds and fixes header guards that do not adhere to LLVM style.
17
/// For the user-facing documentation see:
18
/// http://clang.llvm.org/extra/clang-tidy/checks/llvm/header-guard.html
19
class
LLVMHeaderGuardCheck
:
public
utils::HeaderGuardCheck
{
20
public
:
21
LLVMHeaderGuardCheck
(StringRef
Name
,
ClangTidyContext
*Context);
22
23
bool
shouldSuggestEndifComment
(StringRef
Filename
)
override
{
return
false
; }
24
std::string
getHeaderGuard
(StringRef
Filename
, StringRef OldGuard)
override
;
25
};
26
27
}
// namespace clang::tidy::llvm_check
28
29
#endif
// LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_LLVM_HEADERGUARDCHECK_H
Name
llvm::SmallString< 256U > Name
Definition:
ChainedComparisonCheck.cpp:42
Filename
std::string Filename
Filename as a string.
Definition:
IncludeOrderCheck.cpp:39
clang::tidy::ClangTidyContext
Every ClangTidyCheck reports errors through a DiagnosticsEngine provided by this context.
Definition:
ClangTidyDiagnosticConsumer.h:69
clang::tidy::llvm_check::LLVMHeaderGuardCheck
Finds and fixes header guards that do not adhere to LLVM style.
Definition:
HeaderGuardCheck.h:19
clang::tidy::llvm_check::LLVMHeaderGuardCheck::getHeaderGuard
std::string getHeaderGuard(StringRef Filename, StringRef OldGuard) override
Gets the canonical header guard for a file.
Definition:
HeaderGuardCheck.cpp:19
clang::tidy::llvm_check::LLVMHeaderGuardCheck::shouldSuggestEndifComment
bool shouldSuggestEndifComment(StringRef Filename) override
Returns true if the check should suggest inserting a trailing comment on the #endif of the header gua...
Definition:
HeaderGuardCheck.h:23
clang::tidy::utils::HeaderGuardCheck
Finds and fixes header guards.
Definition:
HeaderGuard.h:18
clang::tidy::llvm_check
Definition:
HeaderGuardCheck.cpp:13
Generated on Sat Dec 21 2024 14:58:59 for clang-tools by
1.9.6