Skip to content

Commit f860f8b

Browse files
committed
add task for linking
In MSVC (at least), linking requires accessing metadata, which generates reads.
1 parent 4d3ef6b commit f860f8b

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

src/librustc/dep_graph/dep_node.rs

+2
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ pub enum DepNode<D: Clone + Debug> {
8181
TransCrateItem(D),
8282
TransInlinedItem(D),
8383
TransWriteMetadata,
84+
LinkBinary,
8485

8586
// Nodes representing bits of computed IR in the tcx. Each shared
8687
// table in the tcx (or elsewhere) maps to one of these
@@ -178,6 +179,7 @@ impl<D: Clone + Debug> DepNode<D> {
178179
LateLintCheck => Some(LateLintCheck),
179180
TransCrate => Some(TransCrate),
180181
TransWriteMetadata => Some(TransWriteMetadata),
182+
LinkBinary => Some(LinkBinary),
181183
Hir(ref d) => op(d).map(Hir),
182184
MetaData(ref d) => op(d).map(MetaData),
183185
CollectItem(ref d) => op(d).map(CollectItem),

src/librustc_trans/back/link.rs

+3
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ use middle::dependency_format::Linkage;
2525
use CrateTranslation;
2626
use util::common::time;
2727
use util::fs::fix_windows_verbatim_for_gcc;
28+
use rustc::dep_graph::DepNode;
2829
use rustc::ty::TyCtxt;
2930
use rustc_back::tempdir::TempDir;
3031

@@ -183,6 +184,8 @@ pub fn link_binary(sess: &Session,
183184
trans: &CrateTranslation,
184185
outputs: &OutputFilenames,
185186
crate_name: &str) -> Vec<PathBuf> {
187+
let _task = sess.dep_graph.in_task(DepNode::LinkBinary);
188+
186189
let mut out_filenames = Vec::new();
187190
for &crate_type in sess.crate_types.borrow().iter() {
188191
if invalid_output_for_target(sess, crate_type) {

0 commit comments

Comments
 (0)