]> git.lizzy.rs Git - rust.git/commitdiff
add task for linking
authorNiko Matsakis <niko@alum.mit.edu>
Wed, 18 May 2016 13:23:40 +0000 (09:23 -0400)
committerNiko Matsakis <niko@alum.mit.edu>
Wed, 18 May 2016 14:11:36 +0000 (10:11 -0400)
In MSVC (at least), linking requires accessing metadata, which generates
reads.

src/librustc/dep_graph/dep_node.rs
src/librustc_trans/back/link.rs

index f2c9d0b122016a0155baff4415e6d5885f58f62e..84c84a7ed57a2656af76de3a0a0428d53c0d10f3 100644 (file)
@@ -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
@@ -178,6 +179,7 @@ pub fn map_def<E, OP>(&self, mut op: OP) -> Option<DepNode<E>>
             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),
index 00d9658cb59439a719b6c5b368679a0161392953..b5248c209a30a16d283929afa5a198ee0faf3f12 100644 (file)
@@ -25,6 +25,7 @@
 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;
 
@@ -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) {