9#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CPPCOREGUIDELINES_MACROUSAGECHECK_H
10#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CPPCOREGUIDELINES_MACROUSAGECHECK_H
12#include "../ClangTidyCheck.h"
13#include "clang/Lex/MacroInfo.h"
18namespace tidy::cppcoreguidelines {
29 AllowedRegexp(
Options.get(
"AllowedRegexp",
"^DEBUG_*")),
30 CheckCapsOnly(
Options.get(
"CheckCapsOnly", false)),
31 IgnoreCommandLineMacros(
Options.get(
"IgnoreCommandLineMacros", true)) {}
33 return LangOpts.CPlusPlus11;
37 Preprocessor *ModuleExpanderPP)
override;
43 std::string AllowedRegexp;
47 bool IgnoreCommandLineMacros;
llvm::SmallString< 256U > Name
Base class for all clang-tidy checks.
Every ClangTidyCheck reports errors through a DiagnosticsEngine provided by this context.
Find macro usage that is considered problematic because better language constructs exist for the task...
MacroUsageCheck(StringRef Name, ClangTidyContext *Context)
bool isLanguageVersionSupported(const LangOptions &LangOpts) const override
Override this to disable registering matchers and PP callbacks if an invalid language version is bein...
void warnMacro(const MacroDirective *MD, StringRef MacroName)
void registerPPCallbacks(const SourceManager &SM, Preprocessor *PP, Preprocessor *ModuleExpanderPP) override
Override this to register PPCallbacks in the preprocessor.
void storeOptions(ClangTidyOptions::OptionMap &Opts) override
Should store all options supported by this check with their current values or default values for opti...
void warnNaming(const MacroDirective *MD, StringRef MacroName)
===– Representation.cpp - ClangDoc Representation --------—*- C++ -*-===//
llvm::StringMap< ClangTidyValue > OptionMap