Skip to content

Commit 282d72f

Browse files
committed
Inline a few things.
1 parent 49e024e commit 282d72f

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/librustc_query_system/query/plumbing.rs

+8-1
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ enum QueryResult<CTX: QueryContext> {
8080
}
8181

8282
impl<CTX: QueryContext, C: QueryCache> QueryState<CTX, C> {
83+
#[inline(always)]
8384
pub fn iter_results<R>(
8485
&self,
8586
f: impl for<'a> FnOnce(
@@ -89,6 +90,7 @@ impl<CTX: QueryContext, C: QueryCache> QueryState<CTX, C> {
8990
self.cache.iter(&self.shards, |shard| &mut shard.cache, f)
9091
}
9192

93+
#[inline(always)]
9294
pub fn all_inactive(&self) -> bool {
9395
let shards = self.shards.lock_shards();
9496
shards.iter().all(|shard| shard.active.is_empty())
@@ -645,6 +647,7 @@ where
645647
/// side-effects -- e.g., in order to report errors for erroneous programs.
646648
///
647649
/// Note: The optimization is only available during incr. comp.
650+
#[inline(never)]
648651
fn ensure_query_impl<CTX, C>(
649652
tcx: CTX,
650653
state: &QueryState<CTX, C>,
@@ -681,7 +684,8 @@ fn ensure_query_impl<CTX, C>(
681684
}
682685
}
683686

684-
fn force_query_impl<C, CTX>(
687+
#[inline(never)]
688+
fn force_query_impl<CTX, C>(
685689
tcx: CTX,
686690
state: &QueryState<CTX, C>,
687691
key: C::Key,
@@ -715,6 +719,7 @@ fn force_query_impl<C, CTX>(
715719
);
716720
}
717721

722+
#[inline(always)]
718723
pub fn get_query<Q, CTX>(tcx: CTX, span: Span, key: Q::Key) -> Q::Stored
719724
where
720725
Q: QueryDescription<CTX>,
@@ -726,6 +731,7 @@ where
726731
get_query_impl(tcx, Q::query_state(tcx), span, key, &Q::VTABLE)
727732
}
728733

734+
#[inline(always)]
729735
pub fn ensure_query<Q, CTX>(tcx: CTX, key: Q::Key)
730736
where
731737
Q: QueryDescription<CTX>,
@@ -735,6 +741,7 @@ where
735741
ensure_query_impl(tcx, Q::query_state(tcx), key, &Q::VTABLE)
736742
}
737743

744+
#[inline(always)]
738745
pub fn force_query<Q, CTX>(tcx: CTX, key: Q::Key, span: Span, dep_node: DepNode<CTX::DepKind>)
739746
where
740747
Q: QueryDescription<CTX>,

0 commit comments

Comments
 (0)