Skip to content

Commit

Permalink
Remove unused code from rustc_query_system
Browse files Browse the repository at this point in the history
  • Loading branch information
est31 committed Oct 14, 2020
1 parent 9ed2177 commit 338fad2
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 27 deletions.
4 changes: 0 additions & 4 deletions compiler/rustc_query_system/src/dep_graph/dep_node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -165,10 +165,6 @@ impl WorkProductId {
cgu_name.hash(&mut hasher);
WorkProductId { hash: hasher.finish() }
}

pub fn from_fingerprint(fingerprint: Fingerprint) -> WorkProductId {
WorkProductId { hash: fingerprint }
}
}

impl<HCX> HashStable<HCX> for WorkProductId {
Expand Down
5 changes: 0 additions & 5 deletions compiler/rustc_query_system/src/dep_graph/graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -402,11 +402,6 @@ impl<K: DepKind> DepGraph<K> {
self.data.as_ref().unwrap().previous.fingerprint_of(dep_node)
}

#[inline]
pub fn prev_dep_node_index_of(&self, dep_node: &DepNode<K>) -> SerializedDepNodeIndex {
self.data.as_ref().unwrap().previous.node_to_index(dep_node)
}

/// Checks whether a previous work product exists for `v` and, if
/// so, return the path that leads to it. Used to skip doing work.
pub fn previous_work_product(&self, v: &WorkProductId) -> Option<WorkProduct> {
Expand Down
19 changes: 1 addition & 18 deletions compiler/rustc_query_system/src/dep_graph/query.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
use rustc_data_structures::fx::FxHashMap;
use rustc_data_structures::graph::implementation::{
Direction, Graph, NodeIndex, INCOMING, OUTGOING,
};
use rustc_data_structures::graph::implementation::{Direction, Graph, NodeIndex, INCOMING};

use super::{DepKind, DepNode};

Expand Down Expand Up @@ -52,23 +50,8 @@ impl<K: DepKind> DepGraphQuery<K> {
}
}

/// All nodes reachable from `node`. In other words, things that
/// will have to be recomputed if `node` changes.
pub fn transitive_successors(&self, node: &DepNode<K>) -> Vec<&DepNode<K>> {
self.reachable_nodes(node, OUTGOING)
}

/// All nodes that can reach `node`.
pub fn transitive_predecessors(&self, node: &DepNode<K>) -> Vec<&DepNode<K>> {
self.reachable_nodes(node, INCOMING)
}

/// Just the outgoing edges from `node`.
pub fn immediate_successors(&self, node: &DepNode<K>) -> Vec<&DepNode<K>> {
if let Some(&index) = self.indices.get(&node) {
self.graph.successor_nodes(index).map(|s| self.graph.node_data(s)).collect()
} else {
vec![]
}
}
}

0 comments on commit 338fad2

Please sign in to comment.