9 #ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_IDENTIFIERNAMINGCHECK_H 10 #define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_IDENTIFIERNAMINGCHECK_H 12 #include "../ClangTidyCheck.h" 19 namespace readability {
41 void check(
const ast_matchers::MatchFinder::MatchResult &Result)
override;
43 Preprocessor *ModuleExpanderPP)
override;
61 : Case(Case), Prefix(Prefix), Suffix(Suffix) {}
63 llvm::Optional<CaseType>
Case;
74 ConflictsWithMacroDefinition,
80 IgnoreFailureThreshold,
114 typedef llvm::DenseMap<NamingCheckId, NamingCheckFailure>
118 void checkMacro(SourceManager &sourceMgr,
const Token &MacroNameTok,
119 const MacroInfo *MI);
122 void expandMacro(
const Token &MacroNameTok,
const MacroInfo *MI);
125 std::vector<llvm::Optional<NamingStyle>> NamingStyles;
126 bool IgnoreFailedSplit;
134 #endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_IDENTIFIERNAMINGCHECK_H
Holds an identifier name check failure, tracking the kind of the identifier, its possible fixup and t...
void registerPPCallbacks(const SourceManager &SM, Preprocessor *PP, Preprocessor *ModuleExpanderPP) override
Override this to register PPCallbacks in the preprocessor.
void check(const ast_matchers::MatchFinder::MatchResult &Result) override
ClangTidyChecks that register ASTMatchers should do the actual work in here.
bool ShouldFix() const
Whether the failure should be fixed or not.
llvm::Optional< CaseType > Case
IdentifierNamingCheck(StringRef Name, ClangTidyContext *Context)
Base class for all clang-tidy checks.
bool ShouldNotify() const
void expandMacro(const Token &MacroNameTok, const MacroInfo *MI)
Add a usage of a macro if it already has a violation.
std::pair< SourceLocation, std::string > NamingCheckId
The fixup will conflict with a macro definition, so we can't fix it automatically.
void registerMatchers(ast_matchers::MatchFinder *Finder) override
Override this to register AST matchers with Finder.
static constexpr llvm::StringLiteral Name
std::map< std::string, std::string > OptionMap
void onEndOfTranslationUnit() override
void storeOptions(ClangTidyOptions::OptionMap &Opts) override
Should store all options supported by this check with their current values or default values for opti...
void checkMacro(SourceManager &sourceMgr, const Token &MacroNameTok, const MacroInfo *MI)
Check Macros for style violations.
===– Representation.cpp - ClangDoc Representation --------—*- C++ -*-===//
llvm::DenseMap< NamingCheckId, NamingCheckFailure > NamingCheckFailureMap
NamingStyle(llvm::Optional< CaseType > Case, const std::string &Prefix, const std::string &Suffix)
Every ClangTidyCheck reports errors through a DiagnosticsEngine provided by this context.
ShouldFixStatus
This enum will be used in select of the diagnostic message.
llvm::DenseSet< unsigned > RawUsageLocs
A set of all the identifier usages starting SourceLocation, in their encoded form.
Checks for identifiers naming style mismatch.