Unify query name and node name.

This commit is contained in:
Camille GILLOT 2020-10-11 20:46:46 +02:00
parent de763701e1
commit de7da7fd3d
3 changed files with 4 additions and 4 deletions

View File

@ -490,7 +490,7 @@ pub fn rustc_queries(input: TokenStream) -> TokenStream {
// Add the query to the group
query_stream.extend(quote! {
#(#doc_comments)*
[#attribute_stream] fn #name: #name(#arg) #result,
[#attribute_stream] fn #name(#arg) #result,
});
// Create a dep node for the query

View File

@ -250,7 +250,7 @@ macro_rules! query_helper_param_ty {
macro_rules! define_queries {
(<$tcx:tt>
$($(#[$attr:meta])*
[$($modifiers:tt)*] fn $name:ident: $node:ident($($K:tt)*) -> $V:ty,)*) => {
[$($modifiers:tt)*] fn $name:ident($($K:tt)*) -> $V:ty,)*) => {
use std::mem;
use crate::{
@ -356,7 +356,7 @@ pub mod query_values {
impl<$tcx> QueryAccessors<TyCtxt<$tcx>> for queries::$name<$tcx> {
const ANON: bool = is_anon!([$($modifiers)*]);
const EVAL_ALWAYS: bool = is_eval_always!([$($modifiers)*]);
const DEP_KIND: dep_graph::DepKind = dep_graph::DepKind::$node;
const DEP_KIND: dep_graph::DepKind = dep_graph::DepKind::$name;
type Cache = query_storage!([$($modifiers)*][$($K)*, $V]);

View File

@ -121,7 +121,7 @@ pub fn print_stats(tcx: TyCtxt<'_>) {
macro_rules! print_stats {
(<$tcx:tt>
$($(#[$attr:meta])* [$($modifiers:tt)*] fn $name:ident: $node:ident($K:ty) -> $V:ty,)*
$($(#[$attr:meta])* [$($modifiers:tt)*] fn $name:ident($K:ty) -> $V:ty,)*
) => {
fn query_stats(tcx: TyCtxt<'_>) -> Vec<QueryStats> {
let mut queries = Vec::new();