Skip to content

Commit f2dc346

Browse files
authored
Rollup merge of #65162 - Mark-Simulacrum:no-cache-loading-map, 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
2 parents 58bfe3b + 4c32d47 commit f2dc346

File tree

2 files changed

+0
-31
lines changed

2 files changed

+0
-31
lines changed

src/librustc/dep_graph/graph.rs

-23
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,6 @@ struct DepGraphData {
7575
previous_work_products: FxHashMap<WorkProductId, WorkProduct>,
7676

7777
dep_node_debug: Lock<FxHashMap<DepNode, String>>,
78-
79-
// Used for testing, only populated when -Zquery-dep-graph is specified.
80-
loaded_from_cache: Lock<FxHashMap<DepNodeIndex, bool>>,
8178
}
8279

8380
pub fn hash_result<R>(hcx: &mut StableHashingContext<'_>, result: &R) -> Option<Fingerprint>
@@ -104,7 +101,6 @@ impl DepGraph {
104101
emitting_diagnostics_cond_var: Condvar::new(),
105102
previous: prev_graph,
106103
colors: DepNodeColorMap::new(prev_graph_node_count),
107-
loaded_from_cache: Default::default(),
108104
})),
109105
}
110106
}
@@ -874,25 +870,6 @@ impl DepGraph {
874870
}
875871
}
876872
}
877-
878-
pub fn mark_loaded_from_cache(&self, dep_node_index: DepNodeIndex, state: bool) {
879-
debug!("mark_loaded_from_cache({:?}, {})",
880-
self.data.as_ref().unwrap().current.borrow().data[dep_node_index].node,
881-
state);
882-
883-
self.data
884-
.as_ref()
885-
.unwrap()
886-
.loaded_from_cache
887-
.borrow_mut()
888-
.insert(dep_node_index, state);
889-
}
890-
891-
pub fn was_loaded_from_cache(&self, dep_node: &DepNode) -> Option<bool> {
892-
let data = self.data.as_ref().unwrap();
893-
let dep_node_index = data.current.borrow().node_to_node_index[dep_node];
894-
data.loaded_from_cache.borrow().get(&dep_node_index).cloned()
895-
}
896873
}
897874

898875
/// A "work product" is an intermediate result that we save into the

src/librustc/ty/query/plumbing.rs

-8
Original file line numberDiff line numberDiff line change
@@ -489,10 +489,6 @@ impl<'tcx> TyCtxt<'tcx> {
489489
self.incremental_verify_ich::<Q>(&result, dep_node, dep_node_index);
490490
}
491491

492-
if unlikely!(self.sess.opts.debugging_opts.query_dep_graph) {
493-
self.dep_graph.mark_loaded_from_cache(dep_node_index, true);
494-
}
495-
496492
result
497493
}
498494

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

573-
if unlikely!(self.sess.opts.debugging_opts.query_dep_graph) {
574-
self.dep_graph.mark_loaded_from_cache(dep_node_index, false);
575-
}
576-
577569
if unlikely!(!diagnostics.is_empty()) {
578570
if dep_node.kind != crate::dep_graph::DepKind::Null {
579571
self.queries.on_disk_cache

0 commit comments

Comments
 (0)