10 #ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_IDENTIFIERNAMINGCHECK_H
11 #define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_IDENTIFIERNAMINGCHECK_H
13 #include "../ClangTidy.h"
20 namespace readability {
41 void check(
const ast_matchers::MatchFinder::MatchResult &Result)
override;
60 : Case(Case), Prefix(Prefix), Suffix(Suffix) {}
62 llvm::Optional<CaseType>
Case;
89 typedef llvm::DenseMap<NamingCheckId, NamingCheckFailure>
93 void checkMacro(SourceManager &sourceMgr,
const Token &MacroNameTok,
97 void expandMacro(
const Token &MacroNameTok,
const MacroInfo *MI);
100 std::vector<llvm::Optional<NamingStyle>> NamingStyles;
101 bool IgnoreFailedSplit;
109 #endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_IDENTIFIERNAMINGCHECK_H
void registerPPCallbacks(CompilerInstance &Compiler) override
Override this to register PPCallbacks with Compiler.
std::unique_ptr< ast_matchers::MatchFinder > Finder
Holds an identifier name check failure, tracking the kind of the identifer, its possible fixup and th...
void check(const ast_matchers::MatchFinder::MatchResult &Result) override
ClangTidyChecks that register ASTMatchers should do the actual work in here.
llvm::Optional< CaseType > Case
IdentifierNamingCheck(StringRef Name, ClangTidyContext *Context)
Base class for all clang-tidy checks.
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
void registerMatchers(ast_matchers::MatchFinder *Finder) override
Override this to register AST matchers with Finder.
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.
llvm::DenseMap< NamingCheckId, NamingCheckFailure > NamingCheckFailureMap
NamingStyle(llvm::Optional< CaseType > Case, const std::string &Prefix, const std::string &Suffix)
ClangTidyContext & Context
Every ClangTidyCheck reports errors through a DiagnosticsEngine provided by this context.
llvm::DenseSet< unsigned > RawUsageLocs
A set of all the identifier usages starting SourceLocation, in their encoded form.
Checks for identifiers naming style mismatch.
bool ShouldFix
Whether the failure should be fixed or not.