Always calculate glob map but only for glob uses

Previously calculating glob map was *opt-in*, however it did record
node id -> ident use for every use directive. This aims to see if we
can unconditionally calculate the glob map and not regress performance.
This commit is contained in:
Igor Matuszewski 2019-01-06 01:22:52 +01:00
parent 75a369c5b1
commit df9df19507
9 changed files with 11 additions and 41 deletions

View file

@ -1239,7 +1239,6 @@ impl<'l, 'tcx: 'l, 'll, O: DumpOutput + 'll> DumpVisitor<'l, 'tcx, 'll, O> {
// Make a comma-separated list of names of imported modules.
let glob_map = &self.save_ctxt.analysis.glob_map;
let glob_map = glob_map.as_ref().unwrap();
let names = if glob_map.contains_key(&id) {
glob_map.get(&id).unwrap().iter().map(|n| n.to_string()).collect()
} else {

View file

@ -1122,8 +1122,6 @@ pub fn process_crate<'l, 'tcx, H: SaveHandler>(
mut handler: H,
) {
tcx.dep_graph.with_ignore(|| {
assert!(analysis.glob_map.is_some());
info!("Dumping crate {}", cratename);
let save_ctxt = SaveContext {