Address comments
This commit is contained in:
parent
60ed37c2e1
commit
62e4bcb168
2 changed files with 14 additions and 16 deletions
|
@ -250,7 +250,7 @@ impl<K: DepKind> DepGraph<K> {
|
||||||
/// in the query infrastructure, and is not currently needed by the
|
/// in the query infrastructure, and is not currently needed by the
|
||||||
/// decoding of any query results. Should the need arise in the future,
|
/// decoding of any query results. Should the need arise in the future,
|
||||||
/// we should consider extending the query system with this functionality.
|
/// we should consider extending the query system with this functionality.
|
||||||
pub fn with_query_deserialization<OP, R>(op: OP) -> R
|
pub fn with_query_deserialization<OP, R>(&self, op: OP) -> R
|
||||||
where
|
where
|
||||||
OP: FnOnce() -> R,
|
OP: FnOnce() -> R,
|
||||||
{
|
{
|
||||||
|
@ -881,7 +881,7 @@ impl<K: DepKind> DepGraphData<K> {
|
||||||
);
|
);
|
||||||
|
|
||||||
if !side_effects.is_empty() {
|
if !side_effects.is_empty() {
|
||||||
DepGraph::<K>::with_query_deserialization(|| {
|
qcx.dep_context().dep_graph().with_query_deserialization(|| {
|
||||||
self.emit_side_effects(qcx, dep_node_index, side_effects)
|
self.emit_side_effects(qcx, dep_node_index, side_effects)
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,9 +2,7 @@
|
||||||
//! generate the actual methods on tcx which find and execute the provider,
|
//! generate the actual methods on tcx which find and execute the provider,
|
||||||
//! manage the caches, and so forth.
|
//! manage the caches, and so forth.
|
||||||
|
|
||||||
use crate::dep_graph::{
|
use crate::dep_graph::{DepContext, DepKind, DepNode, DepNodeIndex, DepNodeParams};
|
||||||
DepContext, DepGraph, DepKind, DepNode, DepNodeIndex, DepNodeParams, TaskDepsRef,
|
|
||||||
};
|
|
||||||
use crate::dep_graph::{DepGraphData, HasDepContext};
|
use crate::dep_graph::{DepGraphData, HasDepContext};
|
||||||
use crate::ich::StableHashingContext;
|
use crate::ich::StableHashingContext;
|
||||||
use crate::query::caches::QueryCache;
|
use crate::query::caches::QueryCache;
|
||||||
|
@ -430,8 +428,7 @@ where
|
||||||
|
|
||||||
// Similarly, fingerprint the result to assert that
|
// Similarly, fingerprint the result to assert that
|
||||||
// it doesn't have anything not considered hashable.
|
// it doesn't have anything not considered hashable.
|
||||||
if cfg!(debug_assertions)
|
if cfg!(debug_assertions) && let Some(hash_result) = query.hash_result()
|
||||||
&& let Some(hash_result) = query.hash_result()
|
|
||||||
{
|
{
|
||||||
qcx.dep_context().with_stable_hashing_context(|mut hcx| {
|
qcx.dep_context().with_stable_hashing_context(|mut hcx| {
|
||||||
hash_result(&mut hcx, &result);
|
hash_result(&mut hcx, &result);
|
||||||
|
@ -524,9 +521,10 @@ where
|
||||||
// The call to `with_query_deserialization` enforces that no new `DepNodes`
|
// The call to `with_query_deserialization` enforces that no new `DepNodes`
|
||||||
// are created during deserialization. See the docs of that method for more
|
// are created during deserialization. See the docs of that method for more
|
||||||
// details.
|
// details.
|
||||||
let result = DepGraph::<Qcx::DepKind>::with_query_deserialization(|| {
|
let result = qcx
|
||||||
try_load_from_disk(qcx, prev_dep_node_index)
|
.dep_context()
|
||||||
});
|
.dep_graph()
|
||||||
|
.with_query_deserialization(|| try_load_from_disk(qcx, prev_dep_node_index));
|
||||||
|
|
||||||
prof_timer.finish_with_query_invocation_id(dep_node_index.into());
|
prof_timer.finish_with_query_invocation_id(dep_node_index.into());
|
||||||
|
|
||||||
|
@ -575,7 +573,7 @@ where
|
||||||
let prof_timer = qcx.dep_context().profiler().query_provider();
|
let prof_timer = qcx.dep_context().profiler().query_provider();
|
||||||
|
|
||||||
// The dep-graph for this computation is already in-place.
|
// The dep-graph for this computation is already in-place.
|
||||||
let result = Qcx::DepKind::with_deps(TaskDepsRef::Ignore, || query.compute(qcx, *key));
|
let result = qcx.dep_context().dep_graph().with_ignore(|| query.compute(qcx, *key));
|
||||||
|
|
||||||
prof_timer.finish_with_query_invocation_id(dep_node_index.into());
|
prof_timer.finish_with_query_invocation_id(dep_node_index.into());
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue