mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-29 10:13:54 +00:00
Complete job outside of force_query_with_job.
This commit is contained in:
parent
13d4eb92b8
commit
d2304008c1
@ -484,12 +484,11 @@ where
|
||||
tcx.store_side_effects_for_anon_node(dep_node_index, side_effects);
|
||||
}
|
||||
|
||||
let result = job.complete(result, dep_node_index);
|
||||
(result, dep_node_index)
|
||||
} else if query.eval_always {
|
||||
// `to_dep_node` is expensive for some `DepKind`s.
|
||||
let dep_node = dep_node.unwrap_or_else(|| query.to_dep_node(*tcx.dep_context(), &key));
|
||||
force_query_with_job(tcx, key, job, dep_node, query, compute)
|
||||
force_query_with_job(tcx, key, job.id, dep_node, query, compute)
|
||||
} else {
|
||||
// `to_dep_node` is expensive for some `DepKind`s.
|
||||
let dep_node = dep_node.unwrap_or_else(|| query.to_dep_node(*tcx.dep_context(), &key));
|
||||
@ -500,12 +499,12 @@ where
|
||||
try_load_from_disk_and_cache_in_memory(tcx, &key, &dep_node, query, compute)
|
||||
});
|
||||
if let Some((result, dep_node_index)) = loaded {
|
||||
let result = job.complete(result, dep_node_index);
|
||||
(result, dep_node_index)
|
||||
} else {
|
||||
force_query_with_job(tcx, key, job, dep_node, query, compute)
|
||||
force_query_with_job(tcx, key, job.id, dep_node, query, compute)
|
||||
}
|
||||
};
|
||||
let result = job.complete(result, dep_node_index);
|
||||
(result, Some(dep_node_index))
|
||||
}
|
||||
|
||||
@ -636,22 +635,22 @@ fn incremental_verify_ich<CTX, K, V: Debug>(
|
||||
}
|
||||
}
|
||||
|
||||
fn force_query_with_job<C, CTX>(
|
||||
fn force_query_with_job<CTX, K, V>(
|
||||
tcx: CTX,
|
||||
key: C::Key,
|
||||
job: JobOwner<'_, CTX::DepKind, C>,
|
||||
key: K,
|
||||
job_id: QueryJobId<CTX::DepKind>,
|
||||
dep_node: DepNode<CTX::DepKind>,
|
||||
query: &QueryVtable<CTX, C::Key, C::Value>,
|
||||
compute: fn(CTX::DepContext, C::Key) -> C::Value,
|
||||
) -> (C::Stored, DepNodeIndex)
|
||||
query: &QueryVtable<CTX, K, V>,
|
||||
compute: fn(CTX::DepContext, K) -> V,
|
||||
) -> (V, DepNodeIndex)
|
||||
where
|
||||
C: QueryCache,
|
||||
CTX: QueryContext,
|
||||
K: Debug,
|
||||
{
|
||||
let prof_timer = tcx.dep_context().profiler().query_provider();
|
||||
|
||||
let ((result, dep_node_index), diagnostics) = with_diagnostics(|diagnostics| {
|
||||
tcx.start_query(job.id, diagnostics, || {
|
||||
tcx.start_query(job_id, diagnostics, || {
|
||||
if query.eval_always {
|
||||
tcx.dep_context().dep_graph().with_eval_always_task(
|
||||
dep_node,
|
||||
@ -680,8 +679,6 @@ where
|
||||
tcx.store_side_effects(dep_node_index, side_effects);
|
||||
}
|
||||
|
||||
let result = job.complete(result, dep_node_index);
|
||||
|
||||
(result, dep_node_index)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user