Skip to content

Commit beb61b4

Browse files
nrcnikomatsakis
authored andcommitted
save analysis: don't dump macro refs
1 parent 14bf347 commit beb61b4

File tree

2 files changed

+15
-13
lines changed

2 files changed

+15
-13
lines changed

src/librustc_save_analysis/dump_visitor.rs

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ pub struct DumpVisitor<'l, 'tcx: 'l, 'll, O: DumpOutput + 'll> {
9292
// we only write one macro def per unique macro definition, and
9393
// one macro use per unique callsite span.
9494
// mac_defs: FxHashSet<Span>,
95-
macro_calls: FxHashSet<Span>,
95+
// macro_calls: FxHashSet<Span>,
9696
}
9797

9898
impl<'l, 'tcx: 'l, 'll, O: DumpOutput + 'll> DumpVisitor<'l, 'tcx, 'll, O> {
@@ -108,7 +108,7 @@ impl<'l, 'tcx: 'l, 'll, O: DumpOutput + 'll> DumpVisitor<'l, 'tcx, 'll, O> {
108108
span: span_utils,
109109
cur_scope: CRATE_NODE_ID,
110110
// mac_defs: FxHashSet::default(),
111-
macro_calls: FxHashSet::default(),
111+
// macro_calls: FxHashSet::default(),
112112
}
113113
}
114114

@@ -1031,18 +1031,20 @@ impl<'l, 'tcx: 'l, 'll, O: DumpOutput + 'll> DumpVisitor<'l, 'tcx, 'll, O> {
10311031
/// If the span is not macro-generated, do nothing, else use callee and
10321032
/// callsite spans to record macro definition and use data, using the
10331033
/// mac_uses and mac_defs sets to prevent multiples.
1034-
fn process_macro_use(&mut self, span: Span) {
1035-
let source_span = span.source_callsite();
1036-
if !self.macro_calls.insert(source_span) {
1037-
return;
1038-
}
1034+
fn process_macro_use(&mut self, _span: Span) {
1035+
// FIXME if we're not dumping the defs (see below), there is no point
1036+
// dumping refs either.
1037+
// let source_span = span.source_callsite();
1038+
// if !self.macro_calls.insert(source_span) {
1039+
// return;
1040+
// }
10391041

1040-
let data = match self.save_ctxt.get_macro_use_data(span) {
1041-
None => return,
1042-
Some(data) => data,
1043-
};
1042+
// let data = match self.save_ctxt.get_macro_use_data(span) {
1043+
// None => return,
1044+
// Some(data) => data,
1045+
// };
10441046

1045-
self.dumper.macro_use(data);
1047+
// self.dumper.macro_use(data);
10461048

10471049
// FIXME write the macro def
10481050
// let mut hasher = DefaultHasher::new();

src/librustc_save_analysis/json_dumper.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ impl<'b, O: DumpOutput + 'b> JsonDumper<O> {
9393
self.result.compilation = Some(data);
9494
}
9595

96-
pub fn macro_use(&mut self, data: MacroRef) {
96+
pub fn _macro_use(&mut self, data: MacroRef) {
9797
if self.config.pub_only || self.config.reachable_only {
9898
return;
9999
}

0 commit comments

Comments
 (0)