Skip to content

Commit

Permalink
Rollup merge of rust-lang#65162 - Mark-Simulacrum:no-cache-loading-ma…
Browse files Browse the repository at this point in the history
…p, r=michaelwoerister

Remove loaded_from_cache map from DepGraph

It's now unused, even with -Zquery-dep-graph

From https://github.com/rust-lang/rust/pull/63756/files#r316039379 -- it'll simplify that PR to get this landed separately so we can just remove some of the code that it touches.

r? @Zoxc or @michaelwoerister
  • Loading branch information
Centril authored Oct 8, 2019
2 parents 58bfe3b + 4c32d47 commit f2dc346
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 31 deletions.
23 changes: 0 additions & 23 deletions src/librustc/dep_graph/graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,6 @@ struct DepGraphData {
previous_work_products: FxHashMap<WorkProductId, WorkProduct>,

dep_node_debug: Lock<FxHashMap<DepNode, String>>,

// Used for testing, only populated when -Zquery-dep-graph is specified.
loaded_from_cache: Lock<FxHashMap<DepNodeIndex, bool>>,
}

pub fn hash_result<R>(hcx: &mut StableHashingContext<'_>, result: &R) -> Option<Fingerprint>
Expand All @@ -104,7 +101,6 @@ impl DepGraph {
emitting_diagnostics_cond_var: Condvar::new(),
previous: prev_graph,
colors: DepNodeColorMap::new(prev_graph_node_count),
loaded_from_cache: Default::default(),
})),
}
}
Expand Down Expand Up @@ -874,25 +870,6 @@ impl DepGraph {
}
}
}

pub fn mark_loaded_from_cache(&self, dep_node_index: DepNodeIndex, state: bool) {
debug!("mark_loaded_from_cache({:?}, {})",
self.data.as_ref().unwrap().current.borrow().data[dep_node_index].node,
state);

self.data
.as_ref()
.unwrap()
.loaded_from_cache
.borrow_mut()
.insert(dep_node_index, state);
}

pub fn was_loaded_from_cache(&self, dep_node: &DepNode) -> Option<bool> {
let data = self.data.as_ref().unwrap();
let dep_node_index = data.current.borrow().node_to_node_index[dep_node];
data.loaded_from_cache.borrow().get(&dep_node_index).cloned()
}
}

/// A "work product" is an intermediate result that we save into the
Expand Down
8 changes: 0 additions & 8 deletions src/librustc/ty/query/plumbing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -489,10 +489,6 @@ impl<'tcx> TyCtxt<'tcx> {
self.incremental_verify_ich::<Q>(&result, dep_node, dep_node_index);
}

if unlikely!(self.sess.opts.debugging_opts.query_dep_graph) {
self.dep_graph.mark_loaded_from_cache(dep_node_index, true);
}

result
}

Expand Down Expand Up @@ -570,10 +566,6 @@ impl<'tcx> TyCtxt<'tcx> {
drop(prof_timer);
profq_msg!(self, ProfileQueriesMsg::ProviderEnd);

if unlikely!(self.sess.opts.debugging_opts.query_dep_graph) {
self.dep_graph.mark_loaded_from_cache(dep_node_index, false);
}

if unlikely!(!diagnostics.is_empty()) {
if dep_node.kind != crate::dep_graph::DepKind::Null {
self.queries.on_disk_cache
Expand Down

0 comments on commit f2dc346

Please sign in to comment.