|
3 | 3 | //! manage the caches, and so forth. |
4 | 4 |
|
5 | 5 | use crate::{on_disk_cache, queries, Queries}; |
6 | | -use rustc_middle::dep_graph::{DepKind, DepNode, DepNodeIndex, SerializedDepNodeIndex}; |
| 6 | +use rustc_middle::dep_graph::{DepKind, DepNodeIndex, SerializedDepNodeIndex}; |
7 | 7 | use rustc_middle::ty::tls::{self, ImplicitCtxt}; |
8 | 8 | use rustc_middle::ty::{self, TyCtxt}; |
9 | 9 | use rustc_query_system::dep_graph::HasDepContext; |
@@ -53,36 +53,6 @@ impl QueryContext for QueryCtxt<'tcx> { |
53 | 53 | self.queries.try_collect_active_jobs(**self) |
54 | 54 | } |
55 | 55 |
|
56 | | - fn try_load_from_on_disk_cache(&self, dep_node: &DepNode) { |
57 | | - let cb = &super::QUERY_CALLBACKS[dep_node.kind as usize]; |
58 | | - (cb.try_load_from_on_disk_cache)(**self, dep_node) |
59 | | - } |
60 | | - |
61 | | - fn try_force_from_dep_node(&self, dep_node: &DepNode) -> bool { |
62 | | - debug!("try_force_from_dep_node({:?}) --- trying to force", dep_node); |
63 | | - |
64 | | - // We must avoid ever having to call `force_from_dep_node()` for a |
65 | | - // `DepNode::codegen_unit`: |
66 | | - // Since we cannot reconstruct the query key of a `DepNode::codegen_unit`, we |
67 | | - // would always end up having to evaluate the first caller of the |
68 | | - // `codegen_unit` query that *is* reconstructible. This might very well be |
69 | | - // the `compile_codegen_unit` query, thus re-codegenning the whole CGU just |
70 | | - // to re-trigger calling the `codegen_unit` query with the right key. At |
71 | | - // that point we would already have re-done all the work we are trying to |
72 | | - // avoid doing in the first place. |
73 | | - // The solution is simple: Just explicitly call the `codegen_unit` query for |
74 | | - // each CGU, right after partitioning. This way `try_mark_green` will always |
75 | | - // hit the cache instead of having to go through `force_from_dep_node`. |
76 | | - // This assertion makes sure, we actually keep applying the solution above. |
77 | | - debug_assert!( |
78 | | - dep_node.kind != DepKind::codegen_unit, |
79 | | - "calling force_from_dep_node() on DepKind::codegen_unit" |
80 | | - ); |
81 | | - |
82 | | - let cb = &super::QUERY_CALLBACKS[dep_node.kind as usize]; |
83 | | - (cb.force_from_dep_node)(**self, dep_node) |
84 | | - } |
85 | | - |
86 | 56 | // Interactions with on_disk_cache |
87 | 57 | fn load_side_effects(&self, prev_dep_node_index: SerializedDepNodeIndex) -> QuerySideEffects { |
88 | 58 | self.queries |
|
0 commit comments