#include "MacroRepeatedSideEffectsCheck.h"
#include "clang/Basic/Builtins.h"
#include "clang/Frontend/CompilerInstance.h"
#include "clang/Lex/MacroArgs.h"
#include "clang/Lex/PPCallbacks.h"
#include "clang/Lex/Preprocessor.h"
#include <stack>
namespace clang::tidy::bugprone {
namespace {
class MacroRepeatedPPCallbacks : public PPCallbacks { … };
}
void MacroRepeatedPPCallbacks::MacroExpands(const Token &MacroNameTok,
const MacroDefinition &MD,
SourceRange Range,
const MacroArgs *Args) { … }
unsigned MacroRepeatedPPCallbacks::countArgumentExpansions(
const MacroInfo *MI, const IdentifierInfo *Arg) const { … }
bool MacroRepeatedPPCallbacks::hasSideEffects(
const Token *ResultArgToks) const { … }
void MacroRepeatedSideEffectsCheck::registerPPCallbacks(
const SourceManager &SM, Preprocessor *PP, Preprocessor *ModuleExpanderPP) { … }
}