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;
58 : Case(Case), Prefix(Prefix), Suffix(Suffix) {}
91 typedef llvm::DenseMap<NamingCheckId, NamingCheckFailure>
95 void checkMacro(SourceManager &sourceMgr,
const Token &MacroNameTok,
99 void expandMacro(
const Token &MacroNameTok,
const MacroInfo *MI);
102 std::vector<NamingStyle> NamingStyles;
103 bool IgnoreFailedSplit;
111 #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.
IdentifierNamingCheck(StringRef Name, ClangTidyContext *Context)
Base class for all clang-tidy checks.
NamingStyle(CaseType Case, const std::string &Prefix, const std::string &Suffix)
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
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.