Categorize queries for later self-profiling

Change the define_queries! macro per feedback on #51657.

Big thanks to @mark-i-m for the help getting the macro changes correct!
This commit is contained in:
Wesley Wiser 2018-05-19 13:50:58 -04:00
parent 4f3c7a472b
commit 0223ef9011
2 changed files with 563 additions and 453 deletions

File diff suppressed because it is too large Load diff

View file

@ -631,9 +631,19 @@ macro_rules! handle_cycle_error {
}
macro_rules! define_queries {
(<$tcx:tt> $($category:tt {
$($(#[$attr:meta])* [$($modifiers:tt)*] fn $name:ident: $node:ident($K:ty) -> $V:ty,)*
},)*) => {
define_queries_inner! { <$tcx>
$($( $(#[$attr])* category<$category> [$($modifiers)*] fn $name: $node($K) -> $V,)*)*
}
}
}
macro_rules! define_queries_inner {
(<$tcx:tt>
$($(#[$attr:meta])*
[$($modifiers:tt)*] fn $name:ident: $node:ident($K:ty) -> $V:ty,)*) => {
$($(#[$attr:meta])* category<$category:tt>
[$($modifiers:tt)*] fn $name:ident: $node:ident($K:ty) -> $V:ty,)*) => {
use std::mem;
#[cfg(parallel_queries)]