Skip to content

Commit 64bcf3b

Browse files
committed
Rename rustc_query_append! to rustc_with_all_queries!
1 parent 4c83e55 commit 64bcf3b

File tree

5 files changed

+21
-7
lines changed

5 files changed

+21
-7
lines changed

compiler/rustc_macros/src/query.rs

+15-3
Original file line numberDiff line numberDiff line change
@@ -407,11 +407,23 @@ pub(super) fn rustc_queries(input: TokenStream) -> TokenStream {
407407
}
408408

409409
TokenStream::from(quote! {
410+
/// Higher-order macro that invokes the specified macro with a prepared
411+
/// list of all query signatures (including modifiers).
412+
///
413+
/// This allows multiple simpler macros to each have access to the list
414+
/// of queries.
410415
#[macro_export]
411-
macro_rules! rustc_query_append {
412-
($macro:ident! $( [$($other:tt)*] )?) => {
416+
macro_rules! rustc_with_all_queries {
417+
(
418+
// The macro to invoke once, on all queries (plus extras).
419+
$macro:ident!
420+
421+
// Within [], an optional list of extra "query" signatures to
422+
// pass to the given macro, in addition to the actual queries.
423+
$( [$($extra_fake_queries:tt)*] )?
424+
) => {
413425
$macro! {
414-
$( $($other)* )?
426+
$( $($extra_fake_queries)* )?
415427
#query_stream
416428
}
417429
}

compiler/rustc_middle/src/dep_graph/dep_node.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,9 @@ macro_rules! define_dep_nodes {
8383
};
8484
}
8585

86-
rustc_query_append!(define_dep_nodes![
86+
// Create various data structures for each query, and also for a few things
87+
// that aren't queries.
88+
rustc_with_all_queries!(define_dep_nodes![
8789
/// We use this for most things when incr. comp. is turned off.
8890
[] fn Null() -> (),
8991
/// We use this to create a forever-red node.

compiler/rustc_middle/src/query/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2578,5 +2578,5 @@ rustc_queries! {
25782578
}
25792579
}
25802580

2581-
rustc_query_append! { define_callbacks! }
2581+
rustc_with_all_queries! { define_callbacks! }
25822582
rustc_feedable_queries! { define_feedable! }

compiler/rustc_query_impl/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ pub fn query_system<'a>(
234234
}
235235
}
236236

237-
rustc_middle::rustc_query_append! { define_queries! }
237+
rustc_middle::rustc_with_all_queries! { define_queries! }
238238

239239
pub fn provide(providers: &mut rustc_middle::util::Providers) {
240240
providers.hooks.alloc_self_profile_query_strings = alloc_self_profile_query_strings;

compiler/rustc_query_impl/src/plumbing.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -575,7 +575,7 @@ where
575575
}
576576

577577
// NOTE: `$V` isn't used here, but we still need to match on it so it can be passed to other macros
578-
// invoked by `rustc_query_append`.
578+
// invoked by `rustc_with_all_queries`.
579579
macro_rules! define_queries {
580580
(
581581
$($(#[$attr:meta])*

0 commit comments

Comments
 (0)