diff options
| author | Camille GILLOT <gillot.camille@gmail.com> | 2020-03-29 11:44:40 +0200 |
|---|---|---|
| committer | Camille GILLOT <gillot.camille@gmail.com> | 2020-05-01 15:10:12 +0200 |
| commit | 282d72f6bb6ad8c00b9d5bbd06e7946a37d412ef (patch) | |
| tree | a3369f1f6a8d2fb181e8729327ee337c2963b848 | |
| parent | 49e024ee7c404fb767d8560b1cf248929f8d7574 (diff) | |
| download | rust-282d72f6bb6ad8c00b9d5bbd06e7946a37d412ef.tar.gz rust-282d72f6bb6ad8c00b9d5bbd06e7946a37d412ef.zip | |
Inline a few things.
| -rw-r--r-- | src/librustc_query_system/query/plumbing.rs | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/librustc_query_system/query/plumbing.rs b/src/librustc_query_system/query/plumbing.rs index c22ea24bb16..bea064ab94c 100644 --- a/src/librustc_query_system/query/plumbing.rs +++ b/src/librustc_query_system/query/plumbing.rs @@ -80,6 +80,7 @@ enum QueryResult<CTX: QueryContext> { } impl<CTX: QueryContext, C: QueryCache> QueryState<CTX, C> { + #[inline(always)] pub fn iter_results<R>( &self, f: impl for<'a> FnOnce( @@ -89,6 +90,7 @@ impl<CTX: QueryContext, C: QueryCache> QueryState<CTX, C> { self.cache.iter(&self.shards, |shard| &mut shard.cache, f) } + #[inline(always)] pub fn all_inactive(&self) -> bool { let shards = self.shards.lock_shards(); shards.iter().all(|shard| shard.active.is_empty()) @@ -645,6 +647,7 @@ where /// side-effects -- e.g., in order to report errors for erroneous programs. /// /// Note: The optimization is only available during incr. comp. +#[inline(never)] fn ensure_query_impl<CTX, C>( tcx: CTX, state: &QueryState<CTX, C>, @@ -681,7 +684,8 @@ fn ensure_query_impl<CTX, C>( } } -fn force_query_impl<C, CTX>( +#[inline(never)] +fn force_query_impl<CTX, C>( tcx: CTX, state: &QueryState<CTX, C>, key: C::Key, @@ -715,6 +719,7 @@ fn force_query_impl<C, CTX>( ); } +#[inline(always)] pub fn get_query<Q, CTX>(tcx: CTX, span: Span, key: Q::Key) -> Q::Stored where Q: QueryDescription<CTX>, @@ -726,6 +731,7 @@ where get_query_impl(tcx, Q::query_state(tcx), span, key, &Q::VTABLE) } +#[inline(always)] pub fn ensure_query<Q, CTX>(tcx: CTX, key: Q::Key) where Q: QueryDescription<CTX>, @@ -735,6 +741,7 @@ where ensure_query_impl(tcx, Q::query_state(tcx), key, &Q::VTABLE) } +#[inline(always)] pub fn force_query<Q, CTX>(tcx: CTX, key: Q::Key, span: Span, dep_node: DepNode<CTX::DepKind>) where Q: QueryDescription<CTX>, |
