clang-tools
6.0.0
llvm.src
tools
clang
tools
extra
clang-tidy
llvm
HeaderGuardCheck.h
Go to the documentation of this file.
1
//===--- HeaderGuardCheck.h - clang-tidy ------------------------*- C++ -*-===//
2
//
3
// The LLVM Compiler Infrastructure
4
//
5
// This file is distributed under the University of Illinois Open Source
6
// License. See LICENSE.TXT for details.
7
//
8
//===----------------------------------------------------------------------===//
9
10
#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_LLVM_HEADER_GUARD_CHECK_H
11
#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_LLVM_HEADER_GUARD_CHECK_H
12
13
#include "../utils/HeaderGuard.h"
14
15
namespace
clang
{
16
namespace
tidy {
17
namespace
llvm
{
18
19
/// Finds and fixes header guards that do not adhere to LLVM style.
20
/// For the user-facing documentation see:
21
/// http://clang.llvm.org/extra/clang-tidy/checks/llvm-header-guard.html
22
/// The check supports these options:
23
/// - `HeaderFileExtensions`: a comma-separated list of filename extensions of
24
/// header files (The filename extension should not contain "." prefix).
25
/// ",h,hh,hpp,hxx" by default.
26
/// For extension-less header files, using an empty string or leaving an
27
/// empty string between "," if there are other filename extensions.
28
class
LLVMHeaderGuardCheck
:
public
utils::HeaderGuardCheck
{
29
public
:
30
LLVMHeaderGuardCheck
(StringRef
Name
,
ClangTidyContext
*Context);
31
32
bool
shouldSuggestEndifComment
(StringRef
Filename
)
override
{
return
false
; }
33
std::string
getHeaderGuard
(StringRef
Filename
, StringRef OldGuard)
override
;
34
};
35
36
}
// namespace llvm
37
}
// namespace tidy
38
}
// namespace clang
39
40
#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_LLVM_HEADER_GUARD_CHECK_H
llvm
Definition:
ClangTidyOptions.cpp:31
Name
StringHandle Name
Definition:
PreprocessorTracker.cpp:525
clang::tidy::utils::HeaderGuardCheck
Finds and fixes header guards.
Definition:
HeaderGuard.h:27
clang::tidy::llvm::LLVMHeaderGuardCheck::LLVMHeaderGuardCheck
LLVMHeaderGuardCheck(StringRef Name, ClangTidyContext *Context)
Definition:
HeaderGuardCheck.cpp:16
clang::tidy::llvm::LLVMHeaderGuardCheck::getHeaderGuard
std::string getHeaderGuard(StringRef Filename, StringRef OldGuard) override
Gets the canonical header guard for a file.
Definition:
HeaderGuardCheck.cpp:20
Filename
std::string Filename
Filename as a string.
Definition:
IncludeOrderCheck.cpp:38
clang::tidy::llvm::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:32
clang
Definition:
AndroidTidyModule.cpp:28
clang::tidy::ClangTidyContext
Every ClangTidyCheck reports errors through a DiagnosticsEngine provided by this context.
Definition:
ClangTidyDiagnosticConsumer.h:104
clang::tidy::llvm::LLVMHeaderGuardCheck
Finds and fixes header guards that do not adhere to LLVM style.
Definition:
HeaderGuardCheck.h:28
Generated on Fri Mar 2 2018 13:29:34 for clang-tools by
1.8.13