kill a bunch of one off tasks

This commit is contained in:
Niko Matsakis 2017-04-18 08:20:12 -04:00
parent 810e0151af
commit 8388772f42
13 changed files with 1 additions and 49 deletions

View File

@ -56,21 +56,14 @@ pub enum DepNode<D: Clone + Debug> {
WorkProduct(Arc<WorkProductId>), WorkProduct(Arc<WorkProductId>),
// Represents different phases in the compiler. // Represents different phases in the compiler.
CollectLanguageItems,
ResolveLifetimes,
RegionResolveCrate, RegionResolveCrate,
PluginRegistrar,
StabilityIndex,
Coherence, Coherence,
Resolve, Resolve,
EntryPoint,
CheckEntryFn,
CoherenceCheckTrait(D), CoherenceCheckTrait(D),
CoherenceCheckImpl(D), CoherenceCheckImpl(D),
CoherenceOverlapCheck(D), CoherenceOverlapCheck(D),
CoherenceOverlapCheckSpecial(D), CoherenceOverlapCheckSpecial(D),
Variance, Variance,
UnusedTraitCheck,
PrivacyAccessLevels(CrateNum), PrivacyAccessLevels(CrateNum),
// Represents the MIR for a fn; also used as the task node for // Represents the MIR for a fn; also used as the task node for
@ -83,13 +76,10 @@ pub enum DepNode<D: Clone + Debug> {
BorrowCheck(D), BorrowCheck(D),
RvalueCheck(D), RvalueCheck(D),
Reachability, Reachability,
DeadCheck,
LateLintCheck, LateLintCheck,
TransCrate,
TransCrateItem(D), TransCrateItem(D),
TransInlinedItem(D), TransInlinedItem(D),
TransWriteMetadata, TransWriteMetadata,
LinkBinary,
// Nodes representing bits of computed IR in the tcx. Each shared // Nodes representing bits of computed IR in the tcx. Each shared
// table in the tcx (or elsewhere) maps to one of these // table in the tcx (or elsewhere) maps to one of these
@ -200,24 +190,14 @@ impl<D: Clone + Debug> DepNode<D> {
BorrowCheckKrate => Some(BorrowCheckKrate), BorrowCheckKrate => Some(BorrowCheckKrate),
MirKrate => Some(MirKrate), MirKrate => Some(MirKrate),
TypeckBodiesKrate => Some(TypeckBodiesKrate), TypeckBodiesKrate => Some(TypeckBodiesKrate),
CollectLanguageItems => Some(CollectLanguageItems),
ResolveLifetimes => Some(ResolveLifetimes),
RegionResolveCrate => Some(RegionResolveCrate), RegionResolveCrate => Some(RegionResolveCrate),
PluginRegistrar => Some(PluginRegistrar),
StabilityIndex => Some(StabilityIndex),
Coherence => Some(Coherence), Coherence => Some(Coherence),
Resolve => Some(Resolve), Resolve => Some(Resolve),
EntryPoint => Some(EntryPoint),
CheckEntryFn => Some(CheckEntryFn),
Variance => Some(Variance), Variance => Some(Variance),
UnusedTraitCheck => Some(UnusedTraitCheck),
PrivacyAccessLevels(k) => Some(PrivacyAccessLevels(k)), PrivacyAccessLevels(k) => Some(PrivacyAccessLevels(k)),
Reachability => Some(Reachability), Reachability => Some(Reachability),
DeadCheck => Some(DeadCheck),
LateLintCheck => Some(LateLintCheck), LateLintCheck => Some(LateLintCheck),
TransCrate => Some(TransCrate),
TransWriteMetadata => Some(TransWriteMetadata), TransWriteMetadata => Some(TransWriteMetadata),
LinkBinary => Some(LinkBinary),
// work product names do not need to be mapped, because // work product names do not need to be mapped, because
// they are always absolute. // they are always absolute.

View File

@ -12,7 +12,6 @@
// closely. The idea is that all reachable symbols are live, codes called // closely. The idea is that all reachable symbols are live, codes called
// from live codes are live, and everything else is dead. // from live codes are live, and everything else is dead.
use dep_graph::DepNode;
use hir::map as hir_map; use hir::map as hir_map;
use hir::{self, PatKind}; use hir::{self, PatKind};
use hir::intravisit::{self, Visitor, NestedVisitorMap}; use hir::intravisit::{self, Visitor, NestedVisitorMap};
@ -594,7 +593,6 @@ impl<'a, 'tcx> Visitor<'tcx> for DeadVisitor<'a, 'tcx> {
} }
pub fn check_crate<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>) { pub fn check_crate<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>) {
let _task = tcx.dep_graph.in_task(DepNode::DeadCheck);
let access_levels = &ty::queries::privacy_access_levels::get(tcx, DUMMY_SP, LOCAL_CRATE); let access_levels = &ty::queries::privacy_access_levels::get(tcx, DUMMY_SP, LOCAL_CRATE);
let krate = tcx.hir.krate(); let krate = tcx.hir.krate();
let live_symbols = find_live(tcx, access_levels, krate); let live_symbols = find_live(tcx, access_levels, krate);

View File

@ -9,7 +9,6 @@
// except according to those terms. // except according to those terms.
use dep_graph::DepNode;
use hir::map as hir_map; use hir::map as hir_map;
use hir::def_id::{CRATE_DEF_INDEX}; use hir::def_id::{CRATE_DEF_INDEX};
use session::{config, Session}; use session::{config, Session};
@ -57,8 +56,6 @@ impl<'a, 'tcx> ItemLikeVisitor<'tcx> for EntryContext<'a, 'tcx> {
} }
pub fn find_entry_point(session: &Session, hir_map: &hir_map::Map) { pub fn find_entry_point(session: &Session, hir_map: &hir_map::Map) {
let _task = hir_map.dep_graph.in_task(DepNode::EntryPoint);
let any_exe = session.crate_types.borrow().iter().any(|ty| { let any_exe = session.crate_types.borrow().iter().any(|ty| {
*ty == config::CrateTypeExecutable *ty == config::CrateTypeExecutable
}); });

View File

@ -21,7 +21,6 @@
pub use self::LangItem::*; pub use self::LangItem::*;
use dep_graph::DepNode;
use hir::map as hir_map; use hir::map as hir_map;
use session::Session; use session::Session;
use hir::def_id::DefId; use hir::def_id::DefId;
@ -236,7 +235,6 @@ pub fn extract(attrs: &[ast::Attribute]) -> Option<Symbol> {
pub fn collect_language_items(session: &Session, pub fn collect_language_items(session: &Session,
map: &hir_map::Map) map: &hir_map::Map)
-> LanguageItems { -> LanguageItems {
let _task = map.dep_graph.in_task(DepNode::CollectLanguageItems);
let krate: &hir::Crate = map.krate(); let krate: &hir::Crate = map.krate();
let mut collector = LanguageItemCollector::new(session, map); let mut collector = LanguageItemCollector::new(session, map);
collector.collect(krate); collector.collect(krate);

View File

@ -15,7 +15,6 @@
//! used between functions, and they operate in a purely top-down //! used between functions, and they operate in a purely top-down
//! way. Therefore we break lifetime name resolution into a separate pass. //! way. Therefore we break lifetime name resolution into a separate pass.
use dep_graph::DepNode;
use hir::map::Map; use hir::map::Map;
use session::Session; use session::Session;
use hir::def::Def; use hir::def::Def;
@ -259,7 +258,6 @@ const ROOT_SCOPE: ScopeRef<'static> = &Scope::Root;
pub fn krate(sess: &Session, pub fn krate(sess: &Session,
hir_map: &Map) hir_map: &Map)
-> Result<NamedRegionMap, usize> { -> Result<NamedRegionMap, usize> {
let _task = hir_map.dep_graph.in_task(DepNode::ResolveLifetimes);
let krate = hir_map.krate(); let krate = hir_map.krate();
let mut map = NamedRegionMap { let mut map = NamedRegionMap {
defs: NodeMap(), defs: NodeMap(),

View File

@ -13,7 +13,6 @@
pub use self::StabilityLevel::*; pub use self::StabilityLevel::*;
use dep_graph::DepNode;
use hir::map as hir_map; use hir::map as hir_map;
use lint; use lint;
use hir::def::Def; use hir::def::Def;
@ -383,7 +382,6 @@ impl<'a, 'tcx> Index<'tcx> {
// Put the active features into a map for quick lookup // Put the active features into a map for quick lookup
self.active_features = active_lib_features.iter().map(|&(ref s, _)| s.clone()).collect(); self.active_features = active_lib_features.iter().map(|&(ref s, _)| s.clone()).collect();
let _task = tcx.dep_graph.in_task(DepNode::StabilityIndex);
let krate = tcx.hir.krate(); let krate = tcx.hir.krate();
let mut annotator = Annotator { let mut annotator = Annotator {
tcx: tcx, tcx: tcx,
@ -397,7 +395,6 @@ impl<'a, 'tcx> Index<'tcx> {
} }
pub fn new(hir_map: &hir_map::Map) -> Index<'tcx> { pub fn new(hir_map: &hir_map::Map) -> Index<'tcx> {
let _task = hir_map.dep_graph.in_task(DepNode::StabilityIndex);
let krate = hir_map.krate(); let krate = hir_map.krate();
let mut is_staged_api = false; let mut is_staged_api = false;
@ -662,7 +659,6 @@ pub fn check_unused_or_stable_features<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>) {
let access_levels = &ty::queries::privacy_access_levels::get(tcx, DUMMY_SP, LOCAL_CRATE); let access_levels = &ty::queries::privacy_access_levels::get(tcx, DUMMY_SP, LOCAL_CRATE);
if tcx.stability.borrow().staged_api[&LOCAL_CRATE] && tcx.sess.features.borrow().staged_api { if tcx.stability.borrow().staged_api[&LOCAL_CRATE] && tcx.sess.features.borrow().staged_api {
let _task = tcx.dep_graph.in_task(DepNode::StabilityIndex);
let krate = tcx.hir.krate(); let krate = tcx.hir.krate();
let mut missing = MissingStabilityAnnotations { let mut missing = MissingStabilityAnnotations {
tcx: tcx, tcx: tcx,

View File

@ -8,7 +8,6 @@
// option. This file may not be copied, modified, or distributed // option. This file may not be copied, modified, or distributed
// except according to those terms. // except according to those terms.
use rustc::dep_graph::DepNode;
use rustc::hir::itemlikevisit::ItemLikeVisitor; use rustc::hir::itemlikevisit::ItemLikeVisitor;
use rustc::hir::map::Map; use rustc::hir::map::Map;
use rustc::hir; use rustc::hir;
@ -16,7 +15,6 @@ use syntax::ast;
use syntax::attr; use syntax::attr;
pub fn find(hir_map: &Map) -> Option<ast::NodeId> { pub fn find(hir_map: &Map) -> Option<ast::NodeId> {
let _task = hir_map.dep_graph.in_task(DepNode::PluginRegistrar);
let krate = hir_map.krate(); let krate = hir_map.krate();
let mut finder = Finder { registrar: None }; let mut finder = Finder { registrar: None };

View File

@ -14,7 +14,6 @@ use syntax::ast;
use syntax::attr; use syntax::attr;
use errors; use errors;
use syntax_pos::Span; use syntax_pos::Span;
use rustc::dep_graph::DepNode;
use rustc::hir::map::Map; use rustc::hir::map::Map;
use rustc::hir::itemlikevisit::ItemLikeVisitor; use rustc::hir::itemlikevisit::ItemLikeVisitor;
use rustc::hir; use rustc::hir;
@ -44,7 +43,6 @@ impl<'v> ItemLikeVisitor<'v> for RegistrarFinder {
pub fn find_plugin_registrar(diagnostic: &errors::Handler, pub fn find_plugin_registrar(diagnostic: &errors::Handler,
hir_map: &Map) hir_map: &Map)
-> Option<ast::NodeId> { -> Option<ast::NodeId> {
let _task = hir_map.dep_graph.in_task(DepNode::PluginRegistrar);
let krate = hir_map.krate(); let krate = hir_map.krate();
let mut finder = RegistrarFinder { registrars: Vec::new() }; let mut finder = RegistrarFinder { registrars: Vec::new() };

View File

@ -192,8 +192,6 @@ pub fn link_binary(sess: &Session,
trans: &CrateTranslation, trans: &CrateTranslation,
outputs: &OutputFilenames, outputs: &OutputFilenames,
crate_name: &str) -> Vec<PathBuf> { crate_name: &str) -> Vec<PathBuf> {
let _task = sess.dep_graph.in_task(DepNode::LinkBinary);
let mut out_filenames = Vec::new(); let mut out_filenames = Vec::new();
for &crate_type in sess.crate_types.borrow().iter() { for &crate_type in sess.crate_types.borrow().iter() {
// Ignore executable crates if we have -Z no-trans, as they will error. // Ignore executable crates if we have -Z no-trans, as they will error.

View File

@ -38,7 +38,7 @@ use rustc::hir::def_id::LOCAL_CRATE;
use middle::lang_items::StartFnLangItem; use middle::lang_items::StartFnLangItem;
use middle::cstore::EncodedMetadata; use middle::cstore::EncodedMetadata;
use rustc::ty::{self, Ty, TyCtxt}; use rustc::ty::{self, Ty, TyCtxt};
use rustc::dep_graph::{AssertDepGraphSafe, DepNode}; use rustc::dep_graph::AssertDepGraphSafe;
use rustc::middle::cstore::LinkMeta; use rustc::middle::cstore::LinkMeta;
use rustc::hir::map as hir_map; use rustc::hir::map as hir_map;
use rustc::util::common::time; use rustc::util::common::time;
@ -1057,8 +1057,6 @@ pub fn trans_crate<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
analysis: ty::CrateAnalysis, analysis: ty::CrateAnalysis,
incremental_hashes_map: &IncrementalHashesMap) incremental_hashes_map: &IncrementalHashesMap)
-> CrateTranslation { -> CrateTranslation {
let _task = tcx.dep_graph.in_task(DepNode::TransCrate);
// Be careful with this krate: obviously it gives access to the // Be careful with this krate: obviously it gives access to the
// entire contents of the krate. So if you push any subtasks of // entire contents of the krate. So if you push any subtasks of
// `TransCrate`, you need to be careful to register "reads" of the // `TransCrate`, you need to be careful to register "reads" of the

View File

@ -9,7 +9,6 @@
// except according to those terms. // except according to those terms.
use lint; use lint;
use rustc::dep_graph::DepNode;
use rustc::ty::TyCtxt; use rustc::ty::TyCtxt;
use syntax::ast; use syntax::ast;
@ -62,8 +61,6 @@ impl<'a, 'tcx, 'v> ItemLikeVisitor<'v> for CheckVisitor<'a, 'tcx> {
} }
pub fn check_crate<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>) { pub fn check_crate<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>) {
let _task = tcx.dep_graph.in_task(DepNode::UnusedTraitCheck);
let mut used_trait_imports = DefIdSet(); let mut used_trait_imports = DefIdSet();
for &body_id in tcx.hir.krate().bodies.keys() { for &body_id in tcx.hir.krate().bodies.keys() {
let item_id = tcx.hir.body_owner(body_id); let item_id = tcx.hir.body_owner(body_id);

View File

@ -18,7 +18,6 @@
use hir::def_id::{CrateNum, DefId, LOCAL_CRATE}; use hir::def_id::{CrateNum, DefId, LOCAL_CRATE};
use rustc::ty::{self, TyCtxt, TypeFoldable}; use rustc::ty::{self, TyCtxt, TypeFoldable};
use rustc::ty::maps::Providers; use rustc::ty::maps::Providers;
use rustc::dep_graph::DepNode;
use syntax::ast; use syntax::ast;
use syntax_pos::DUMMY_SP; use syntax_pos::DUMMY_SP;
@ -132,7 +131,6 @@ fn coherent_trait<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
} }
pub fn check_coherence<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>) { pub fn check_coherence<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>) {
let _task = tcx.dep_graph.in_task(DepNode::Coherence);
for &trait_def_id in tcx.hir.krate().trait_impls.keys() { for &trait_def_id in tcx.hir.krate().trait_impls.keys() {
ty::queries::coherent_trait::get(tcx, DUMMY_SP, (LOCAL_CRATE, trait_def_id)); ty::queries::coherent_trait::get(tcx, DUMMY_SP, (LOCAL_CRATE, trait_def_id));
} }

View File

@ -104,7 +104,6 @@ pub use rustc::middle;
pub use rustc::session; pub use rustc::session;
pub use rustc::util; pub use rustc::util;
use dep_graph::DepNode;
use hir::map as hir_map; use hir::map as hir_map;
use rustc::infer::InferOk; use rustc::infer::InferOk;
use rustc::ty::subst::Substs; use rustc::ty::subst::Substs;
@ -273,7 +272,6 @@ fn check_start_fn_ty<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
} }
fn check_for_entry_fn<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>) { fn check_for_entry_fn<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>) {
let _task = tcx.dep_graph.in_task(DepNode::CheckEntryFn);
if let Some((id, sp)) = *tcx.sess.entry_fn.borrow() { if let Some((id, sp)) = *tcx.sess.entry_fn.borrow() {
match tcx.sess.entry_type.get() { match tcx.sess.entry_type.get() {
Some(config::EntryMain) => check_main_fn_ty(tcx, id, sp), Some(config::EntryMain) => check_main_fn_ty(tcx, id, sp),