10#ifndef LLVM_CLANG_TOOLS_EXTRA_FIND_ALL_SYMBOLS_FIND_ALL_MACROS_H
11#define LLVM_CLANG_TOOLS_EXTRA_FIND_ALL_SYMBOLS_FIND_ALL_MACROS_H
15#include "clang/Lex/PPCallbacks.h"
20namespace find_all_symbols {
22class HeaderMapCollector;
31 : Reporter(Reporter), SM(SM), Collector(Collector) {}
34 const MacroDirective *MD)
override;
36 void MacroExpands(
const Token &MacroNameTok,
const MacroDefinition &MD,
37 SourceRange
Range,
const MacroArgs *
Args)
override;
39 void Ifdef(SourceLocation
Loc,
const Token &MacroNameTok,
40 const MacroDefinition &MD)
override;
42 void Ifndef(SourceLocation
Loc,
const Token &MacroNameTok,
43 const MacroDefinition &MD)
override;
48 std::optional<SymbolInfo> CreateMacroSymbol(
const Token &MacroNameTok,
51 void MacroUsed(
const Token &
Name,
const MacroDefinition &MD);
56 SourceManager *
const SM;
llvm::SmallString< 256U > Name
CharSourceRange Range
SourceRange for the file name.
A preprocessor that collects all macro symbols.
void MacroDefined(const Token &MacroNameTok, const MacroDirective *MD) override
FindAllMacros(SymbolReporter *Reporter, SourceManager *SM, HeaderMapCollector *Collector=nullptr)
void Ifdef(SourceLocation Loc, const Token &MacroNameTok, const MacroDefinition &MD) override
void MacroExpands(const Token &MacroNameTok, const MacroDefinition &MD, SourceRange Range, const MacroArgs *Args) override
void Ifndef(SourceLocation Loc, const Token &MacroNameTok, const MacroDefinition &MD) override
void EndOfMainFile() override
std::map< SymbolInfo, Signals > SignalMap
An interface for classes that collect symbols.
===– Representation.cpp - ClangDoc Representation --------—*- C++ -*-===//