9 #ifndef LLVM_CLANG_ANALYSIS_MACROEXPANSIONCONTEXT_H
10 #define LLVM_CLANG_ANALYSIS_MACROEXPANSIONCONTEXT_H
15 #include "llvm/ADT/DenseMap.h"
16 #include "llvm/ADT/SmallString.h"
17 #include "llvm/ADT/SmallVector.h"
89 std::optional<StringRef>
96 std::optional<StringRef>
107 using ExpansionMap = llvm::DenseMap<SourceLocation, MacroExpansionText>;
108 using ExpansionRangeMap = llvm::DenseMap<SourceLocation, SourceLocation>;
112 ExpansionMap ExpandedTokens;
116 ExpansionRangeMap ExpansionRanges;
125 void onTokenLexed(
const Token &Tok);
Defines the clang::LangOptions interface.
Defines the clang::Preprocessor interface.
Defines the clang::SourceLocation class and associated facilities.
Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that i...
MacroExpansionContext tracks the macro expansions processed by the Preprocessor.
void registerForPreprocessor(Preprocessor &PP)
Register the necessary callbacks to the Preprocessor to record the expansion events and the generated...
LLVM_DUMP_METHOD void dumpExpandedTextsToStream(raw_ostream &OS) const
LLVM_DUMP_METHOD void dumpExpandedTexts() const
LLVM_DUMP_METHOD void dumpExpansionRanges() const
MacroExpansionContext(const LangOptions &LangOpts)
Creates a MacroExpansionContext.
LLVM_DUMP_METHOD void dumpExpansionRangesToStream(raw_ostream &OS) const
std::optional< StringRef > getExpandedText(SourceLocation MacroExpansionLoc) const
std::optional< StringRef > getOriginalText(SourceLocation MacroExpansionLoc) const
Engages in a tight little dance with the lexer to efficiently preprocess tokens.
Encodes a location in the source.
This class handles loading and caching of source files into memory.
Token - This structure provides full information about a lexed token.
The JSON file list parser is used to communicate input to InstallAPI.