Skip to content

Commit aa26586

Browse files
committed
Add DepGraph to tcx.
1 parent c77cd48 commit aa26586

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/librustc/middle/ty/context.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
// FIXME: (@jroesch) @eddyb should remove this when he renames ctxt
1414
#![allow(non_camel_case_types)]
1515

16+
use dep_graph::{DepGraph, DepNode, DepTrackingMap};
1617
use front::map as ast_map;
1718
use session::Session;
1819
use lint;
@@ -224,6 +225,8 @@ pub struct ctxt<'tcx> {
224225
region_interner: RefCell<FnvHashMap<&'tcx Region, &'tcx Region>>,
225226
stability_interner: RefCell<FnvHashMap<&'tcx attr::Stability, &'tcx attr::Stability>>,
226227

228+
pub dep_graph: DepGraph,
229+
227230
/// Common types, pre-interned for your convenience.
228231
pub types: CommonTypes<'tcx>,
229232

@@ -483,14 +486,15 @@ impl<'tcx> ctxt<'tcx> {
483486
{
484487
let interner = RefCell::new(FnvHashMap());
485488
let common_types = CommonTypes::new(&arenas.type_, &interner);
486-
489+
let dep_graph = DepGraph::new(s.opts.incremental_compilation);
487490
tls::enter(ctxt {
488491
arenas: arenas,
489492
interner: interner,
490493
substs_interner: RefCell::new(FnvHashMap()),
491494
bare_fn_interner: RefCell::new(FnvHashMap()),
492495
region_interner: RefCell::new(FnvHashMap()),
493496
stability_interner: RefCell::new(FnvHashMap()),
497+
dep_graph: dep_graph.clone(),
494498
types: common_types,
495499
named_region_map: named_region_map,
496500
region_maps: region_maps,

0 commit comments

Comments
 (0)