1
Fork 0

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 // Add the query to the group
query_stream.extend(quote! { query_stream.extend(quote! {
#(#doc_comments)* #(#doc_comments)*
[#attribute_stream] fn #name: #name(#arg) #result, [#attribute_stream] fn #name(#arg) #result,
}); });
// Create a dep node for the query // Create a dep node for the query

View file

@ -250,7 +250,7 @@ macro_rules! query_helper_param_ty {
macro_rules! define_queries { macro_rules! define_queries {
(<$tcx:tt> (<$tcx:tt>
$($(#[$attr:meta])* $($(#[$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 std::mem;
use crate::{ use crate::{
@ -356,7 +356,7 @@ macro_rules! define_queries {
impl<$tcx> QueryAccessors<TyCtxt<$tcx>> for queries::$name<$tcx> { impl<$tcx> QueryAccessors<TyCtxt<$tcx>> for queries::$name<$tcx> {
const ANON: bool = is_anon!([$($modifiers)*]); const ANON: bool = is_anon!([$($modifiers)*]);
const EVAL_ALWAYS: bool = is_eval_always!([$($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]); type Cache = query_storage!([$($modifiers)*][$($K)*, $V]);

View file

@ -121,7 +121,7 @@ pub fn print_stats(tcx: TyCtxt<'_>) {
macro_rules! print_stats { macro_rules! print_stats {
(<$tcx:tt> (<$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> { fn query_stats(tcx: TyCtxt<'_>) -> Vec<QueryStats> {
let mut queries = Vec::new(); let mut queries = Vec::new();