Auto merge of #52476 - wesleywiser:categorize_queries, r=nikomatsakis

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!

I'm pulling this commit out of the other PR because it's hard to keep up-to-date as queries are added or changed.

r? @nikomatsakis
This commit is contained in:
bors 2018-07-20 11:10:58 +00:00
commit 3bea4d1fc6
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)]