diff options
| author | Michael Woerister <michaelwoerister@posteo> | 2017-09-14 17:42:12 +0200 |
|---|---|---|
| committer | Michael Woerister <michaelwoerister@posteo> | 2017-09-20 11:21:25 +0200 |
| commit | 25bc69ec20f19232eb0a1f6cac13cdefdf880dfe (patch) | |
| tree | f9c30738bd42c9ee879ffa06e951deaeaad4bb54 /src/librustc_incremental | |
| parent | 3b75a3dfeaf8261bd59343792b3650550be86c95 (diff) | |
| download | rust-25bc69ec20f19232eb0a1f6cac13cdefdf880dfe.tar.gz rust-25bc69ec20f19232eb0a1f6cac13cdefdf880dfe.zip | |
incr.comp.: Allow for marking DepKinds as inputs.
Diffstat (limited to 'src/librustc_incremental')
| -rw-r--r-- | src/librustc_incremental/persist/hash.rs | 23 | ||||
| -rw-r--r-- | src/librustc_incremental/persist/preds/mod.rs | 2 |
2 files changed, 4 insertions, 21 deletions
diff --git a/src/librustc_incremental/persist/hash.rs b/src/librustc_incremental/persist/hash.rs index 8355f319139..8a7011a0dcc 100644 --- a/src/librustc_incremental/persist/hash.rs +++ b/src/librustc_incremental/persist/hash.rs @@ -45,21 +45,6 @@ impl<'a, 'tcx> HashContext<'a, 'tcx> { } } - pub fn is_hashable(tcx: TyCtxt, dep_node: &DepNode) -> bool { - match dep_node.kind { - DepKind::Krate | - DepKind::Hir | - DepKind::InScopeTraits | - DepKind::HirBody => - true, - DepKind::MetaData => { - let def_id = dep_node.extract_def_id(tcx).unwrap(); - !def_id.is_local() - } - _ => false, - } - } - pub fn hash(&mut self, dep_node: &DepNode) -> Option<Fingerprint> { match dep_node.kind { DepKind::Krate => { @@ -79,13 +64,11 @@ impl<'a, 'tcx> HashContext<'a, 'tcx> { // save it for others to use. DepKind::MetaData => { let def_id = dep_node.extract_def_id(self.tcx).unwrap(); - if !def_id.is_local() { - Some(self.metadata_hash(def_id, + assert!(!def_id.is_local()); + + Some(self.metadata_hash(def_id, def_id.krate, |this| &mut this.metadata_hashes)) - } else { - None - } } _ => { diff --git a/src/librustc_incremental/persist/preds/mod.rs b/src/librustc_incremental/persist/preds/mod.rs index 5483134523c..46bb37b017f 100644 --- a/src/librustc_incremental/persist/preds/mod.rs +++ b/src/librustc_incremental/persist/preds/mod.rs @@ -66,7 +66,7 @@ impl<'q> Predecessors<'q> { // Reduce the graph to the most important nodes. let compress::Reduction { graph, input_nodes } = compress::reduce_graph(&query.graph, - |n| HashContext::is_hashable(tcx, n), + |n| n.kind.is_input(), |n| is_output(n)); let mut hashes = FxHashMap(); |
