Skip to content

Commit

Permalink
Unify query name and node name.
Browse files Browse the repository at this point in the history
  • Loading branch information
cjgillot committed Oct 22, 2020
1 parent de76370 commit de7da7f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion compiler/rustc_macros/src/query.rs
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_middle/src/ty/query/plumbing.rs
Expand Up @@ -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::{
Expand Down Expand Up @@ -356,7 +356,7 @@ macro_rules! define_queries {
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]);

Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_middle/src/ty/query/stats.rs
Expand Up @@ -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();
Expand Down

0 comments on commit de7da7f

Please sign in to comment.