diff options
| author | Igor Matuszewski <Xanewok@gmail.com> | 2019-01-06 01:22:52 +0100 |
|---|---|---|
| committer | Igor Matuszewski <Xanewok@gmail.com> | 2019-01-13 10:42:59 +0100 |
| commit | df9df19507ea4573ff141d253b2e95cd5b6cd0ff (patch) | |
| tree | 9a8676d87faacb301c696229774b4c72c703115c /src/librustc_driver | |
| parent | 75a369c5b11459baa6bf7734eeb6135998a0a7de (diff) | |
| download | rust-df9df19507ea4573ff141d253b2e95cd5b6cd0ff.tar.gz rust-df9df19507ea4573ff141d253b2e95cd5b6cd0ff.zip | |
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.
Diffstat (limited to 'src/librustc_driver')
| -rw-r--r-- | src/librustc_driver/driver.rs | 15 | ||||
| -rw-r--r-- | src/librustc_driver/lib.rs | 2 | ||||
| -rw-r--r-- | src/librustc_driver/test.rs | 2 |
3 files changed, 2 insertions, 17 deletions
diff --git a/src/librustc_driver/driver.rs b/src/librustc_driver/driver.rs index bfff592a5dd..e026909d127 100644 --- a/src/librustc_driver/driver.rs +++ b/src/librustc_driver/driver.rs @@ -26,7 +26,7 @@ use rustc_passes::{self, ast_validation, hir_stats, loops, rvalue_promotion}; use rustc_plugin as plugin; use rustc_plugin::registry::Registry; use rustc_privacy; -use rustc_resolve::{MakeGlobMap, Resolver, ResolverArenas}; +use rustc_resolve::{Resolver, ResolverArenas}; use rustc_traits; use rustc_typeck as typeck; use syntax::{self, ast, attr, diagnostics, visit}; @@ -179,7 +179,6 @@ pub fn compile_input( registry, &crate_name, addl_plugins, - control.make_glob_map, |expanded_crate| { let mut state = CompileState::state_after_expand( input, @@ -394,7 +393,6 @@ pub struct CompileController<'a> { // FIXME we probably want to group the below options together and offer a // better API, rather than this ad-hoc approach. - pub make_glob_map: MakeGlobMap, // Whether the compiler should keep the ast beyond parsing. pub keep_ast: bool, // -Zcontinue-parse-after-error @@ -417,7 +415,6 @@ impl<'a> CompileController<'a> { after_hir_lowering: PhaseController::basic(), after_analysis: PhaseController::basic(), compilation_done: PhaseController::basic(), - make_glob_map: MakeGlobMap::No, keep_ast: false, continue_parse_after_error: false, provide: box |_| {}, @@ -739,7 +736,6 @@ pub fn phase_2_configure_and_expand<F>( registry: Option<Registry>, crate_name: &str, addl_plugins: Option<Vec<String>>, - make_glob_map: MakeGlobMap, after_expand: F, ) -> Result<ExpansionResult, CompileIncomplete> where @@ -759,7 +755,6 @@ where registry, crate_name, addl_plugins, - make_glob_map, &resolver_arenas, &mut crate_loader, after_expand, @@ -785,11 +780,7 @@ where }, analysis: ty::CrateAnalysis { - glob_map: if resolver.make_glob_map { - Some(resolver.glob_map) - } else { - None - }, + glob_map: resolver.glob_map }, }), Err(x) => Err(x), @@ -805,7 +796,6 @@ pub fn phase_2_configure_and_expand_inner<'a, F>( registry: Option<Registry>, crate_name: &str, addl_plugins: Option<Vec<String>>, - make_glob_map: MakeGlobMap, resolver_arenas: &'a ResolverArenas<'a>, crate_loader: &'a mut CrateLoader<'a>, after_expand: F, @@ -937,7 +927,6 @@ where cstore, &krate, crate_name, - make_glob_map, crate_loader, &resolver_arenas, ); diff --git a/src/librustc_driver/lib.rs b/src/librustc_driver/lib.rs index 889e1ec3b98..010ac28cdc9 100644 --- a/src/librustc_driver/lib.rs +++ b/src/librustc_driver/lib.rs @@ -57,7 +57,6 @@ extern crate syntax_pos; use driver::CompileController; use pretty::{PpMode, UserIdentifiedItem}; -use rustc_resolve as resolve; use rustc_save_analysis as save; use rustc_save_analysis::DumpHandler; use rustc_data_structures::sync::{self, Lrc, Ordering::SeqCst}; @@ -950,7 +949,6 @@ pub fn enable_save_analysis(control: &mut CompileController) { }); }; control.after_analysis.run_callback_on_error = true; - control.make_glob_map = resolve::MakeGlobMap::Yes; } impl RustcDefaultCalls { diff --git a/src/librustc_driver/test.rs b/src/librustc_driver/test.rs index 9c027f110eb..afcf08632a4 100644 --- a/src/librustc_driver/test.rs +++ b/src/librustc_driver/test.rs @@ -18,7 +18,6 @@ use rustc::ty::{self, Ty, TyCtxt, TypeFoldable}; use rustc_data_structures::sync::{self, Lrc}; use rustc_lint; use rustc_metadata::cstore::CStore; -use rustc_resolve::MakeGlobMap; use rustc_target::spec::abi::Abi; use syntax; use syntax::ast; @@ -134,7 +133,6 @@ fn test_env_with_pool<F>( None, "test", None, - MakeGlobMap::No, |_| Ok(()), ).expect("phase 2 aborted") }; |
