10 #ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CPPCOREGUIDELINES_MACROUSAGECHECK_H 11 #define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CPPCOREGUIDELINES_MACROUSAGECHECK_H 13 #include "../ClangTidy.h" 14 #include "clang/Lex/Preprocessor.h" 19 namespace cppcoreguidelines {
30 AllowedRegexp(
Options.get(
"AllowedRegexp",
"^DEBUG_*")),
31 CheckCapsOnly(
Options.get(
"CheckCapsOnly", 0)),
32 IgnoreCommandLineMacros(
Options.get(
"IgnoreCommandLineMacros", 1)) {}
35 void warnMacro(
const MacroDirective *
MD, StringRef MacroName);
36 void warnNaming(
const MacroDirective *MD, StringRef MacroName);
40 std::string AllowedRegexp;
44 bool IgnoreCommandLineMacros;
51 #endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CPPCOREGUIDELINES_MACROUSAGECHECK_H void warnNaming(const MacroDirective *MD, StringRef MacroName)
void warnMacro(const MacroDirective *MD, StringRef MacroName)
Base class for all clang-tidy checks.
static constexpr llvm::StringLiteral Name
std::map< std::string, std::string > OptionMap
Find macro usage that is considered problematic because better language constructs exist for the task...
void storeOptions(ClangTidyOptions::OptionMap &Opts) override
Should store all options supported by this check with their current values or default values for opti...
===– Representation.cpp - ClangDoc Representation --------—*- C++ -*-===//
static GeneratorRegistry::Add< MDGenerator > MD(MDGenerator::Format, "Generator for MD output.")
Every ClangTidyCheck reports errors through a DiagnosticsEngine provided by this context.
MacroUsageCheck(StringRef Name, ClangTidyContext *Context)
void registerPPCallbacks(CompilerInstance &Compiler) override
Override this to register PPCallbacks with Compiler.