Skip to content

Commit 2797b2a

Browse files
committed
remove register_reads
The reads will occur naturally as the HIR/MIR is fetched from the tracked tables, and this winds up adding reads to the hir of foreign def-ids somehow.
1 parent b4929d1 commit 2797b2a

File tree

1 file changed

+0
-42
lines changed

1 file changed

+0
-42
lines changed

src/librustc_trans/trans_item.rs

-42
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,6 @@ impl<'a, 'tcx> TransItem<'tcx> {
8383
// that the incoming edges to a particular fn are from a
8484
// particular set.
8585

86-
self.register_reads(ccx);
87-
8886
match *self {
8987
TransItem::Static(node_id) => {
9088
let def_id = ccx.tcx().map.local_def_id(node_id);
@@ -120,46 +118,6 @@ impl<'a, 'tcx> TransItem<'tcx> {
120118
ccx.codegen_unit().name());
121119
}
122120

123-
/// If necessary, creates a subtask for trans'ing a particular item and registers reads on
124-
/// `TypeckItemBody` and `Hir`.
125-
fn register_reads(&self, ccx: &CrateContext<'a, 'tcx>) {
126-
let tcx = ccx.tcx();
127-
let def_id = match *self {
128-
TransItem::Static(node_id) => {
129-
tcx.map.local_def_id(node_id)
130-
}
131-
TransItem::Fn(instance) => {
132-
if let Some(node) = tcx.map.as_local_node_id(instance.def) {
133-
if let hir_map::Node::NodeItem(_) = tcx.map.get(node) {
134-
// This already is a "real" item
135-
instance.def
136-
} else {
137-
// Get the enclosing item and register a read on it
138-
tcx.map.get_parent_did(node)
139-
}
140-
} else {
141-
// Translating an inlined item from another crate? Don't track anything.
142-
return;
143-
}
144-
}
145-
TransItem::DropGlue(_) => {
146-
// Nothing to track for drop glue
147-
return;
148-
}
149-
};
150-
151-
tcx.dep_graph.with_task(DepNode::TransCrateItem(def_id), || {
152-
tcx.dep_graph.read(DepNode::Hir(def_id));
153-
154-
// We are going to be accessing various tables
155-
// generated by TypeckItemBody; we also assume
156-
// that the body passes type check. These tables
157-
// are not individually tracked, so just register
158-
// a read here.
159-
tcx.dep_graph.read(DepNode::TypeckItemBody(def_id));
160-
});
161-
}
162-
163121
pub fn predefine(&self,
164122
ccx: &CrateContext<'a, 'tcx>,
165123
linkage: llvm::Linkage) {

0 commit comments

Comments
 (0)