File tree Expand file tree Collapse file tree 5 files changed +21
-7
lines changed Expand file tree Collapse file tree 5 files changed +21
-7
lines changed Original file line number Diff line number Diff 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 }
Original file line number Diff line number Diff 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.
Original file line number Diff line number Diff line change @@ -2578,5 +2578,5 @@ rustc_queries! {
25782578 }
25792579}
25802580
2581- rustc_query_append ! { define_callbacks! }
2581+ rustc_with_all_queries ! { define_callbacks! }
25822582rustc_feedable_queries ! { define_feedable! }
Original file line number Diff line number Diff 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
239239pub fn provide ( providers : & mut rustc_middle:: util:: Providers ) {
240240 providers. hooks . alloc_self_profile_query_strings = alloc_self_profile_query_strings;
Original file line number Diff line number Diff 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 `.
579579macro_rules! define_queries {
580580 (
581581 $( $( #[ $attr: meta] ) *
You can’t perform that action at this time.
0 commit comments