-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Prehash visibilities in resolver #143371
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Prehash visibilities in resolver #143371
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -43,6 +43,7 @@ use rustc_ast::{ | |
}; | ||
use rustc_data_structures::fx::{FxHashMap, FxHashSet, FxIndexMap, FxIndexSet}; | ||
use rustc_data_structures::intern::Interned; | ||
use rustc_data_structures::stable_hasher::{HashStable, StableHasher}; | ||
use rustc_data_structures::steal::Steal; | ||
use rustc_data_structures::sync::{FreezeReadGuard, FreezeWriteGuard}; | ||
use rustc_data_structures::unord::{UnordMap, UnordSet}; | ||
|
@@ -1701,6 +1702,13 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> { | |
} | ||
|
||
pub fn into_outputs(self) -> ResolverOutputs { | ||
let visibilities_hash = { | ||
let mut hasher = StableHasher::new(); | ||
let mut hcx = self.create_stable_hashing_context(); | ||
self.visibilities_for_hashing.hash_stable(&mut hcx, &mut hasher); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I thought about doing this operation in Is creating the hashing context a more or less expensive operation than adding a table element? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Creating a hashing context is very cheap. It's just moving some pointers around. I guess we could keep a |
||
hasher.finish() | ||
}; | ||
|
||
let proc_macros = self.proc_macros; | ||
let expn_that_defined = self.expn_that_defined; | ||
let extern_crate_map = self.extern_crate_map; | ||
|
@@ -1722,7 +1730,7 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> { | |
|
||
let global_ctxt = ResolverGlobalCtxt { | ||
expn_that_defined, | ||
visibilities_for_hashing: self.visibilities_for_hashing, | ||
visibilities_hash, | ||
effective_visibilities, | ||
extern_crate_map, | ||
module_children: self.module_children, | ||
|
Uh oh!
There was an error while loading. Please reload this page.