rustc_query_system: explicitly register reused dep nodes
Register nodes that we've reused from the previous session explicitly with `OnDiskCache`. Previously, we relied on this happening as a side effect of accessing the nodes in the `PreviousDepGraph`. For the sake of performance and avoiding unintended side effects, register explictily.
This commit is contained in:
parent
eb4fc71dc9
commit
7795801902
6 changed files with 51 additions and 62 deletions
|
@ -5,7 +5,7 @@ use rustc_data_structures::profiling::SelfProfilerRef;
|
|||
use rustc_data_structures::sync::Lock;
|
||||
use rustc_data_structures::thin_vec::ThinVec;
|
||||
use rustc_errors::Diagnostic;
|
||||
use rustc_hir::def_id::{DefPathHash, LocalDefId};
|
||||
use rustc_hir::def_id::LocalDefId;
|
||||
|
||||
mod dep_node;
|
||||
|
||||
|
@ -91,9 +91,9 @@ impl<'tcx> DepContext for TyCtxt<'tcx> {
|
|||
type DepKind = DepKind;
|
||||
type StableHashingContext = StableHashingContext<'tcx>;
|
||||
|
||||
fn register_reused_dep_path_hash(&self, hash: DefPathHash) {
|
||||
fn register_reused_dep_node(&self, dep_node: &DepNode) {
|
||||
if let Some(cache) = self.queries.on_disk_cache.as_ref() {
|
||||
cache.register_reused_dep_path_hash(*self, hash)
|
||||
cache.register_reused_dep_node(*self, dep_node)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue