Skip to content

Commit

Permalink
add task for linking
Browse files Browse the repository at this point in the history
In MSVC (at least), linking requires accessing metadata, which generates
reads.
  • Loading branch information
nikomatsakis committed May 18, 2016
1 parent 4d3ef6b commit f860f8b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/librustc/dep_graph/dep_node.rs
Expand Up @@ -81,6 +81,7 @@ pub enum DepNode<D: Clone + Debug> {
TransCrateItem(D),
TransInlinedItem(D),
TransWriteMetadata,
LinkBinary,

// Nodes representing bits of computed IR in the tcx. Each shared
// table in the tcx (or elsewhere) maps to one of these
Expand Down Expand Up @@ -178,6 +179,7 @@ impl<D: Clone + Debug> DepNode<D> {
LateLintCheck => Some(LateLintCheck),
TransCrate => Some(TransCrate),
TransWriteMetadata => Some(TransWriteMetadata),
LinkBinary => Some(LinkBinary),
Hir(ref d) => op(d).map(Hir),
MetaData(ref d) => op(d).map(MetaData),
CollectItem(ref d) => op(d).map(CollectItem),
Expand Down
3 changes: 3 additions & 0 deletions src/librustc_trans/back/link.rs
Expand Up @@ -25,6 +25,7 @@ use middle::dependency_format::Linkage;
use CrateTranslation;
use util::common::time;
use util::fs::fix_windows_verbatim_for_gcc;
use rustc::dep_graph::DepNode;
use rustc::ty::TyCtxt;
use rustc_back::tempdir::TempDir;

Expand Down Expand Up @@ -183,6 +184,8 @@ pub fn link_binary(sess: &Session,
trans: &CrateTranslation,
outputs: &OutputFilenames,
crate_name: &str) -> Vec<PathBuf> {
let _task = sess.dep_graph.in_task(DepNode::LinkBinary);

let mut out_filenames = Vec::new();
for &crate_type in sess.crate_types.borrow().iter() {
if invalid_output_for_target(sess, crate_type) {
Expand Down

0 comments on commit f860f8b

Please sign in to comment.