clang: lib/AST/DataCollection.cpp Source File (original) (raw)
1
2
3
4
5
6
7
8
12
14namespace data_collection {
15
16
17
18static void printMacroName(llvm::raw_string_ostream &MacroStack,
21 Context.getLangOpts());
22
23
24
25 MacroStack << " ";
26}
27
28
29
30
31
32
34 std::string MacroStack;
35 llvm::raw_string_ostream MacroStackStream(MacroStack);
37
38
39 while (Loc.isMacroID()) {
40
42 Loc = SM.getImmediateMacroCallerLoc(Loc);
43 }
44 return MacroStack;
45}
46
47}
48}
This file declares helper methods for collecting data from AST nodes.
Defines the SourceManager interface.
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
static StringRef getImmediateMacroName(SourceLocation Loc, const SourceManager &SM, const LangOptions &LangOpts)
Retrieve the name of the immediate macro expansion.
Encodes a location in the source.
This class handles loading and caching of source files into memory.
static void printMacroName(llvm::raw_string_ostream &MacroStack, ASTContext &Context, SourceLocation Loc)
Prints the macro name that contains the given SourceLocation into the given raw_string_ostream.
std::string getMacroStack(SourceLocation Loc, ASTContext &Context)
Returns a string that represents all macro expansions that expanded into the given SourceLocation.
The JSON file list parser is used to communicate input to InstallAPI.