about summary refs log tree commit diff
path: root/compiler/rustc_query_impl/src/profiling_support.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2022-09-15 11:54:03 +0000
committerbors <bors@rust-lang.org>2022-09-15 11:54:03 +0000
commit294f0eef736aa13cadf28ce7160a18a94ca7b87c (patch)
treeba2cfdaac7cbfa964493ae51babf16d9888878d0 /compiler/rustc_query_impl/src/profiling_support.rs
parent00fcc82df204ab81cd887da7d04c023a201afd5b (diff)
parentcb2949e6425688078b6b3eb38d91f607ab280a16 (diff)
downloadrust-294f0eef736aa13cadf28ce7160a18a94ca7b87c.tar.gz
rust-294f0eef736aa13cadf28ce7160a18a94ca7b87c.zip
Auto merge of #101173 - jyn514:simplify-macro-arguments, r=cjgillot
Further simplify the macros generated by `rustc_queries`

This doesn't actually move anything outside the macros, but it makes them simpler to read.

- Add a new `rustc_query_names` macro. This allows a much simpler syntax for the matchers in the macros passed to it as a callback.
- Convert `define_dep_nodes` and `alloc_once` to use `rustc_query_names`. This is possible because they only use the names
  (despite the quite complicated matchers in `define_dep_nodes`, none of the other arguments are used).
- Get rid of `rustc_dep_node_append`.

r? `@cjgillot`
Diffstat (limited to 'compiler/rustc_query_impl/src/profiling_support.rs')
-rw-r--r--compiler/rustc_query_impl/src/profiling_support.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/compiler/rustc_query_impl/src/profiling_support.rs b/compiler/rustc_query_impl/src/profiling_support.rs
index 260af0d5408..98ec3bc0977 100644
--- a/compiler/rustc_query_impl/src/profiling_support.rs
+++ b/compiler/rustc_query_impl/src/profiling_support.rs
@@ -307,16 +307,16 @@ pub fn alloc_self_profile_query_strings(tcx: TyCtxt<'_>) {
 
     macro_rules! alloc_once {
         (
-            $($(#[$attr:meta])* [$($modifiers:tt)*] fn $name:ident($K:ty) -> $V:ty,)*
-        ) => {
-            $({
+        $($(#[$attr:meta])*
+            [$($modifiers:tt)*] fn $name:ident($($K:tt)*) -> $V:ty,)*) => {
+            $(
                 alloc_self_profile_query_strings_for_query_cache(
                     tcx,
                     stringify!($name),
                     &tcx.query_caches.$name,
                     &mut string_cache,
                 );
-            })*
+            )+
         }
     }