clang-tools 22.0.0git
clang::tidy::llvm_check::LLVMHeaderGuardCheck Class Reference

Finds and fixes header guards that do not adhere to LLVM style. More...

#include <HeaderGuardCheck.h>

Inheritance diagram for clang::tidy::llvm_check::LLVMHeaderGuardCheck:
[legend]

Public Member Functions

 LLVMHeaderGuardCheck (StringRef Name, ClangTidyContext *Context)
bool shouldSuggestEndifComment (StringRef Filename) override
std::string getHeaderGuard (StringRef Filename, StringRef OldGuard) override
 Gets the canonical header guard for a file.
Public Member Functions inherited from clang::tidy::utils::HeaderGuardCheck
 HeaderGuardCheck (StringRef Name, ClangTidyContext *Context)
void registerPPCallbacks (const SourceManager &SM, Preprocessor *PP, Preprocessor *ModuleExpanderPP) override
std::string sanitizeHeaderGuard (StringRef Guard)
 Ensure that the provided header guard is a non-reserved identifier.
virtual std::string formatEndIf (StringRef HeaderGuard)
 Returns true if the check should suggest inserting a trailing comment / on the #endif of the header guard.

Detailed Description

Finds and fixes header guards that do not adhere to LLVM style.

For the user-facing documentation see: http://clang.llvm.org/extra/clang-tidy/checks/llvm/header-guard.html

Definition at line 19 of file HeaderGuardCheck.h.

Constructor & Destructor Documentation

◆ LLVMHeaderGuardCheck()

clang::tidy::llvm_check::LLVMHeaderGuardCheck::LLVMHeaderGuardCheck ( StringRef Name,
ClangTidyContext * Context )

Member Function Documentation

◆ getHeaderGuard()

std::string clang::tidy::llvm_check::LLVMHeaderGuardCheck::getHeaderGuard ( StringRef Filename,
StringRef OldGuard )
overridevirtual

Gets the canonical header guard for a file.

Implements clang::tidy::utils::HeaderGuardCheck.

Definition at line 19 of file HeaderGuardCheck.cpp.

◆ shouldSuggestEndifComment()

bool clang::tidy::llvm_check::LLVMHeaderGuardCheck::shouldSuggestEndifComment ( StringRef Filename)
inlineoverride

Definition at line 23 of file HeaderGuardCheck.h.


The documentation for this class was generated from the following files: