X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=src%2Flibrustc%2Fdep_graph%2Fdep_node.rs;h=4a763d4144edcbf8a044a2cc5a1b6e2ba9085241;hb=51456a68085be6c4035dae0282ee83b419a4f00c;hp=56b218889854d0a49121b063c42018359575c297;hpb=1855aff8d78e74a7ec5140dbd7bd18fc3566095a;p=rust.git diff --git a/src/librustc/dep_graph/dep_node.rs b/src/librustc/dep_graph/dep_node.rs index 56b21888985..4a763d4144e 100644 --- a/src/librustc/dep_graph/dep_node.rs +++ b/src/librustc/dep_graph/dep_node.rs @@ -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}); } @@ -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> $( @@ -160,6 +169,15 @@ pub fn is_input(&self) -> bool { } } + #[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 { @@ -447,10 +465,10 @@ pub fn fingerprint_needed_for_crate_hash(self) -> bool { // Represents different phases in the compiler. [] RegionScopeTree(DefId), - [] Coherence, - [] CoherenceInherentImplOverlapCheck, + [eval_always] Coherence, + [eval_always] CoherenceInherentImplOverlapCheck, [] CoherenceCheckTrait(DefId), - [] PrivacyAccessLevels(CrateNum), + [eval_always] PrivacyAccessLevels(CrateNum), // Represents the MIR for a fn; also used as the task node for // things read/modify that MIR. @@ -467,7 +485,7 @@ pub fn fingerprint_needed_for_crate_hash(self) -> bool { [] Reachability, [] MirKeys, - [] CrateVariances, + [eval_always] CrateVariances, // Nodes representing bits of computed IR in the tcx. Each shared // table in the tcx (or elsewhere) maps to one of these @@ -497,7 +515,7 @@ pub fn fingerprint_needed_for_crate_hash(self) -> bool { [] DtorckConstraint(DefId), [] AdtDestructor(DefId), [] AssociatedItemDefIds(DefId), - [] InherentImpls(DefId), + [eval_always] InherentImpls(DefId), [] TypeckBodiesKrate, [] TypeckTables(DefId), [] UsedTraitImports(DefId), @@ -567,7 +585,7 @@ pub fn fingerprint_needed_for_crate_hash(self) -> bool { [] IsCompilerBuiltins(CrateNum), [] HasGlobalAllocator(CrateNum), [] ExternCrate(DefId), - [] LintLevels, + [eval_always] LintLevels, [] Specializes { impl1: DefId, impl2: DefId }, [input] InScopeTraits(DefIndex), [] ModuleExports(DefId), @@ -626,7 +644,7 @@ pub fn fingerprint_needed_for_crate_hash(self) -> bool { [] StabilityIndex, [] AllCrateNums, [] ExportedSymbols(CrateNum), - [] CollectAndPartitionTranslationItems, + [eval_always] CollectAndPartitionTranslationItems, [] ExportName(DefId), [] ContainsExternIndicator(DefId), [] IsTranslatedFunction(DefId),