Skip to content

Commit 097bc6a

Browse files
committed
Auto merge of #81892 - jyn514:no-inline, r=cjgillot
[experiment] remove `#[inline]` from rustc_query_system::plumbing These functions have a ton of generic parameters and are instantiated over and over again. Hopefully this will reduce binary bloat and speed up bootstrapping times. r? `@cjgillot`
2 parents 185de5f + 4f77a1a commit 097bc6a

File tree

1 file changed

+0
-10
lines changed

1 file changed

+0
-10
lines changed

compiler/rustc_query_system/src/query/plumbing.rs

-10
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ pub struct QueryState<D, Q, C: QueryCache> {
5050
}
5151

5252
impl<D, Q, C: QueryCache> QueryState<D, Q, C> {
53-
#[inline]
5453
pub(super) fn get_lookup<'tcx>(
5554
&'tcx self,
5655
key: &C::Key,
@@ -84,7 +83,6 @@ where
8483
Q: Clone,
8584
C: QueryCache,
8685
{
87-
#[inline(always)]
8886
pub fn iter_results<R>(
8987
&self,
9088
f: impl for<'a> FnOnce(
@@ -94,7 +92,6 @@ where
9492
self.cache.iter(&self.shards, |shard| &mut shard.cache, f)
9593
}
9694

97-
#[inline(always)]
9895
pub fn all_inactive(&self) -> bool {
9996
let shards = self.shards.lock_shards();
10097
shards.iter().all(|shard| shard.active.is_empty())
@@ -270,7 +267,6 @@ where
270267

271268
/// Completes the query by updating the query cache with the `result`,
272269
/// signals the waiter and forgets the JobOwner, so it won't poison the query
273-
#[inline(always)]
274270
fn complete(self, result: C::Value, dep_node_index: DepNodeIndex) -> C::Stored {
275271
// We can move out of `self` here because we `mem::forget` it below
276272
let key = unsafe { ptr::read(&self.key) };
@@ -294,7 +290,6 @@ where
294290
}
295291
}
296292

297-
#[inline(always)]
298293
fn with_diagnostics<F, R>(f: F) -> (R, ThinVec<Diagnostic>)
299294
where
300295
F: FnOnce(Option<&Lock<ThinVec<Diagnostic>>>) -> R,
@@ -362,7 +357,6 @@ where
362357
/// It returns the shard index and a lock guard to the shard,
363358
/// which will be used if the query is not in the cache and we need
364359
/// to compute it.
365-
#[inline(always)]
366360
fn try_get_cached<CTX, C, R, OnHit, OnMiss>(
367361
tcx: CTX,
368362
state: &QueryState<CTX::DepKind, CTX::Query, C>,
@@ -394,7 +388,6 @@ where
394388
)
395389
}
396390

397-
#[inline(always)]
398391
fn try_execute_query<CTX, C>(
399392
tcx: CTX,
400393
state: &QueryState<CTX::DepKind, CTX::Query, C>,
@@ -727,7 +720,6 @@ fn force_query_impl<CTX, C>(
727720
);
728721
}
729722

730-
#[inline(always)]
731723
pub fn get_query<Q, CTX>(tcx: CTX, span: Span, key: Q::Key) -> Q::Stored
732724
where
733725
Q: QueryDescription<CTX>,
@@ -739,7 +731,6 @@ where
739731
get_query_impl(tcx, Q::query_state(tcx), span, key, &Q::VTABLE)
740732
}
741733

742-
#[inline(always)]
743734
pub fn ensure_query<Q, CTX>(tcx: CTX, key: Q::Key)
744735
where
745736
Q: QueryDescription<CTX>,
@@ -749,7 +740,6 @@ where
749740
ensure_query_impl(tcx, Q::query_state(tcx), key, &Q::VTABLE)
750741
}
751742

752-
#[inline(always)]
753743
pub fn force_query<Q, CTX>(tcx: CTX, key: Q::Key, span: Span, dep_node: DepNode<CTX::DepKind>)
754744
where
755745
Q: QueryDescription<CTX>,

0 commit comments

Comments
 (0)