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

@ -451,7 +451,6 @@ pub fn run_core(options: RustdocOptions) -> (clean::Crate, RenderInfo, RenderOpt
None,
&name,
None,
resolve::MakeGlobMap::No,
&resolver_arenas,
&mut crate_loader,
|_| Ok(()));
@ -476,7 +475,7 @@ pub fn run_core(options: RustdocOptions) -> (clean::Crate, RenderInfo, RenderOpt
}).collect(),
};
let analysis = ty::CrateAnalysis {
glob_map: if resolver.make_glob_map { Some(resolver.glob_map.clone()) } else { None },
glob_map: resolver.glob_map.clone(),
};
let mut arenas = AllArenas::new();

View file

@ -6,7 +6,6 @@ use rustc_driver::{self, driver, target_features, Compilation};
use rustc_driver::driver::phase_2_configure_and_expand;
use rustc_metadata::cstore::CStore;
use rustc_metadata::dynamic_lib::DynamicLibrary;
use rustc_resolve::MakeGlobMap;
use rustc::hir;
use rustc::hir::intravisit;
use rustc::session::{self, CompileIncomplete, config};
@ -100,7 +99,6 @@ pub fn run(mut options: Options) -> isize {
None,
"rustdoc-test",
None,
MakeGlobMap::No,
|_| Ok(()),
).expect("phase_2_configure_and_expand aborted in rustdoc!")
};