Add inlining attributes for query system functions
This commit is contained in:
parent
a049550c45
commit
ab5d3fbe7d
@ -1011,6 +1011,7 @@ impl<'tcx> TyCtxt<'tcx> {
|
||||
|
||||
/// Note that this is *untracked* and should only be used within the query
|
||||
/// system if the result is otherwise tracked through queries
|
||||
#[inline]
|
||||
pub fn cstore_untracked(self) -> MappedReadGuard<'tcx, CrateStoreDyn> {
|
||||
ReadGuard::map(self.untracked.cstore.read(), |c| &**c)
|
||||
}
|
||||
|
@ -279,6 +279,7 @@ impl<K: DepKind> DepGraph<K> {
|
||||
/// `arg` parameter.
|
||||
///
|
||||
/// [rustc dev guide]: https://rustc-dev-guide.rust-lang.org/incremental-compilation.html
|
||||
#[inline(always)]
|
||||
pub fn with_task<Ctxt: HasDepContext<DepKind = K>, A: Debug, R>(
|
||||
&self,
|
||||
key: DepNode<K>,
|
||||
@ -298,6 +299,7 @@ impl<K: DepKind> DepGraph<K> {
|
||||
}
|
||||
}
|
||||
|
||||
#[inline(always)]
|
||||
fn with_task_impl<Ctxt: HasDepContext<DepKind = K>, A: Debug, R>(
|
||||
&self,
|
||||
key: DepNode<K>,
|
||||
@ -598,6 +600,7 @@ impl<K: DepKind> DepGraph<K> {
|
||||
self.data.is_some() && self.dep_node_index_of_opt(dep_node).is_some()
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn prev_fingerprint_of(&self, dep_node: &DepNode<K>) -> Option<Fingerprint> {
|
||||
self.data.as_ref().unwrap().previous.fingerprint_of(dep_node)
|
||||
}
|
||||
@ -1127,6 +1130,7 @@ impl<K: DepKind> CurrentDepGraph<K> {
|
||||
|
||||
/// Writes the node to the current dep-graph and allocates a `DepNodeIndex` for it.
|
||||
/// Assumes that this is a node that has no equivalent in the previous dep-graph.
|
||||
#[inline(always)]
|
||||
fn intern_new_node(
|
||||
&self,
|
||||
profiler: &SelfProfilerRef,
|
||||
@ -1365,6 +1369,7 @@ impl DepNodeColorMap {
|
||||
}
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn insert(&self, index: SerializedDepNodeIndex, color: DepNodeColor) {
|
||||
self.values[index].store(
|
||||
match color {
|
||||
|
@ -394,6 +394,7 @@ where
|
||||
}
|
||||
}
|
||||
|
||||
#[inline(always)]
|
||||
fn execute_job<Q, Qcx>(
|
||||
qcx: Qcx,
|
||||
key: Q::Key,
|
||||
@ -479,6 +480,7 @@ where
|
||||
(result, dep_node_index)
|
||||
}
|
||||
|
||||
#[inline(always)]
|
||||
fn try_load_from_disk_and_cache_in_memory<Q, Qcx>(
|
||||
qcx: Qcx,
|
||||
key: &Q::Key,
|
||||
@ -569,6 +571,7 @@ where
|
||||
Some((result, dep_node_index))
|
||||
}
|
||||
|
||||
#[inline]
|
||||
#[instrument(skip(tcx, result, hash_result), level = "debug")]
|
||||
pub(crate) fn incremental_verify_ich<Tcx, V: Debug>(
|
||||
tcx: Tcx,
|
||||
@ -723,6 +726,7 @@ pub enum QueryMode {
|
||||
Ensure,
|
||||
}
|
||||
|
||||
#[inline(always)]
|
||||
pub fn get_query<Q, Qcx, D>(qcx: Qcx, span: Span, key: Q::Key, mode: QueryMode) -> Option<Q::Value>
|
||||
where
|
||||
D: DepKind,
|
||||
|
Loading…
x
Reference in New Issue
Block a user