88// option. This file may not be copied, modified, or distributed
99// except according to those terms.
1010
11- use dep_graph:: { DepGraph , DepNode } ;
12- use hir:: def_id:: { DefId , CrateNum , CRATE_DEF_INDEX } ;
13- use rustc_data_structures:: bitvec:: BitVector ;
1411use std:: rc:: Rc ;
15- use std:: sync:: Arc ;
1612use syntax:: codemap:: CodeMap ;
1713use syntax_pos:: { BytePos , FileMap } ;
1814use ty:: TyCtxt ;
@@ -31,14 +27,12 @@ pub struct CachingCodemapView<'tcx> {
3127 codemap : & ' tcx CodeMap ,
3228 line_cache : [ CacheEntry ; 3 ] ,
3329 time_stamp : usize ,
34- dep_graph : DepGraph ,
35- dep_tracking_reads : BitVector ,
3630}
3731
3832impl < ' tcx > CachingCodemapView < ' tcx > {
3933 pub fn new < ' a > ( tcx : TyCtxt < ' a , ' tcx , ' tcx > ) -> CachingCodemapView < ' tcx > {
4034 let codemap = tcx. sess . codemap ( ) ;
41- let files = codemap. files_untracked ( ) ;
35+ let files = codemap. files ( ) ;
4236 let first_file = files[ 0 ] . clone ( ) ;
4337 let entry = CacheEntry {
4438 time_stamp : 0 ,
@@ -50,11 +44,9 @@ impl<'tcx> CachingCodemapView<'tcx> {
5044 } ;
5145
5246 CachingCodemapView {
53- dep_graph : tcx. dep_graph . clone ( ) ,
5447 codemap : codemap,
5548 line_cache : [ entry. clone ( ) , entry. clone ( ) , entry. clone ( ) ] ,
5649 time_stamp : 0 ,
57- dep_tracking_reads : BitVector :: new ( files. len ( ) ) ,
5850 }
5951 }
6052
@@ -67,9 +59,6 @@ impl<'tcx> CachingCodemapView<'tcx> {
6759 for cache_entry in self . line_cache . iter_mut ( ) {
6860 if pos >= cache_entry. line_start && pos < cache_entry. line_end {
6961 cache_entry. time_stamp = self . time_stamp ;
70- if self . dep_tracking_reads . insert ( cache_entry. file_index ) {
71- self . dep_graph . read ( dep_node ( cache_entry) ) ;
72- }
7362
7463 return Some ( ( cache_entry. file . clone ( ) ,
7564 cache_entry. line_number ,
@@ -90,7 +79,7 @@ impl<'tcx> CachingCodemapView<'tcx> {
9079 // If the entry doesn't point to the correct file, fix it up
9180 if pos < cache_entry. file . start_pos || pos >= cache_entry. file . end_pos {
9281 let file_valid;
93- let files = self . codemap . files_untracked ( ) ;
82+ let files = self . codemap . files ( ) ;
9483
9584 if files. len ( ) > 0 {
9685 let file_index = self . codemap . lookup_filemap_idx ( pos) ;
@@ -120,21 +109,8 @@ impl<'tcx> CachingCodemapView<'tcx> {
120109 cache_entry. line_end = line_bounds. 1 ;
121110 cache_entry. time_stamp = self . time_stamp ;
122111
123- if self . dep_tracking_reads . insert ( cache_entry. file_index ) {
124- self . dep_graph . read ( dep_node ( cache_entry) ) ;
125- }
126-
127112 return Some ( ( cache_entry. file . clone ( ) ,
128113 cache_entry. line_number ,
129114 pos - cache_entry. line_start ) ) ;
130115 }
131116}
132-
133- fn dep_node ( cache_entry : & CacheEntry ) -> DepNode < DefId > {
134- let def_id = DefId {
135- krate : CrateNum :: from_u32 ( cache_entry. file . crate_of_origin ) ,
136- index : CRATE_DEF_INDEX ,
137- } ;
138- let name = Arc :: new ( cache_entry. file . name . clone ( ) ) ;
139- DepNode :: FileMap ( def_id, name)
140- }
0 commit comments