Module rustc_save_analysis::dump_visitor
source · Expand description
Write the output of rustc’s analysis to an implementor of Dump.
Dumping the analysis is implemented by walking the AST and getting a bunch of
info out from all over the place. We use DefId
s to identify objects. The
tricky part is getting syntactic (span, source text) and semantic (reference
DefId
s) information for parts of expressions which the compiler has discarded.
E.g., in a path foo::bar::baz
, the compiler only keeps a span for the whole
path and a reference to baz
, but we want spans and references for all three
idents.
SpanUtils is used to manipulate spans. In particular, to extract sub-spans
from spans (e.g., the span for bar
from the above example path).
DumpVisitor walks the AST and processes it, and Dumper is used for
recording the output.