File tree 5 files changed +21
-7
lines changed
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 {
407
407
}
408
408
409
409
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.
410
415
#[ 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
+ ) => {
413
425
$macro! {
414
- $( $( $other ) * ) ?
426
+ $( $( $extra_fake_queries ) * ) ?
415
427
#query_stream
416
428
}
417
429
}
Original file line number Diff line number Diff line change @@ -83,7 +83,9 @@ macro_rules! define_dep_nodes {
83
83
} ;
84
84
}
85
85
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![
87
89
/// We use this for most things when incr. comp. is turned off.
88
90
[ ] fn Null ( ) -> ( ) ,
89
91
/// 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! {
2578
2578
}
2579
2579
}
2580
2580
2581
- rustc_query_append ! { define_callbacks! }
2581
+ rustc_with_all_queries ! { define_callbacks! }
2582
2582
rustc_feedable_queries ! { define_feedable! }
Original file line number Diff line number Diff line change @@ -234,7 +234,7 @@ pub fn query_system<'a>(
234
234
}
235
235
}
236
236
237
- rustc_middle:: rustc_query_append ! { define_queries! }
237
+ rustc_middle:: rustc_with_all_queries ! { define_queries! }
238
238
239
239
pub fn provide ( providers : & mut rustc_middle:: util:: Providers ) {
240
240
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
575
575
}
576
576
577
577
// 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 `.
579
579
macro_rules! define_queries {
580
580
(
581
581
$( $( #[ $attr: meta] ) *
You can’t perform that action at this time.
0 commit comments