Skip to content

Commit

Permalink
Allow declaring a DepNode as eval_always
Browse files Browse the repository at this point in the history
  • Loading branch information
wesleywiser committed Oct 26, 2017
1 parent 512f16a commit 9d72fc6
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/librustc/dep_graph/dep_node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,11 @@ macro_rules! is_input_attr {
($attr:ident) => (false);
}

macro_rules! is_eval_always_attr {
(eval_always) => (true);
($attr:ident) => (false);
}

macro_rules! contains_anon_attr {
($($attr:ident),*) => ({$(is_anon_attr!($attr) | )* false});
}
Expand All @@ -98,6 +103,10 @@ macro_rules! contains_input_attr {
($($attr:ident),*) => ({$(is_input_attr!($attr) | )* false});
}

macro_rules! contains_eval_always_attr {
($($attr:ident),*) => ({$(is_eval_always_attr!($attr) | )* false});
}

macro_rules! define_dep_nodes {
(<$tcx:tt>
$(
Expand Down Expand Up @@ -160,6 +169,15 @@ macro_rules! define_dep_nodes {
}
}

#[inline]
pub fn is_eval_always(&self) -> bool {
match *self {
$(
DepKind :: $variant => { contains_eval_always_attr!($($attr), *) }
)*
}
}

#[allow(unreachable_code)]
#[inline]
pub fn has_params(&self) -> bool {
Expand Down

0 comments on commit 9d72fc6

Please sign in to comment.