8
8
// option. This file may not be copied, modified, or distributed
9
9
// except according to those terms.
10
10
11
- use dep_graph:: { DepGraph , DepNode } ;
12
- use hir:: def_id:: { DefId , CrateNum , CRATE_DEF_INDEX } ;
13
- use rustc_data_structures:: bitvec:: BitVector ;
14
11
use std:: rc:: Rc ;
15
- use std:: sync:: Arc ;
16
12
use syntax:: codemap:: CodeMap ;
17
13
use syntax_pos:: { BytePos , FileMap } ;
18
14
use ty:: TyCtxt ;
@@ -31,14 +27,12 @@ pub struct CachingCodemapView<'tcx> {
31
27
codemap : & ' tcx CodeMap ,
32
28
line_cache : [ CacheEntry ; 3 ] ,
33
29
time_stamp : usize ,
34
- dep_graph : DepGraph ,
35
- dep_tracking_reads : BitVector ,
36
30
}
37
31
38
32
impl < ' tcx > CachingCodemapView < ' tcx > {
39
33
pub fn new < ' a > ( tcx : TyCtxt < ' a , ' tcx , ' tcx > ) -> CachingCodemapView < ' tcx > {
40
34
let codemap = tcx. sess . codemap ( ) ;
41
- let files = codemap. files_untracked ( ) ;
35
+ let files = codemap. files ( ) ;
42
36
let first_file = files[ 0 ] . clone ( ) ;
43
37
let entry = CacheEntry {
44
38
time_stamp : 0 ,
@@ -50,11 +44,9 @@ impl<'tcx> CachingCodemapView<'tcx> {
50
44
} ;
51
45
52
46
CachingCodemapView {
53
- dep_graph : tcx. dep_graph . clone ( ) ,
54
47
codemap : codemap,
55
48
line_cache : [ entry. clone ( ) , entry. clone ( ) , entry. clone ( ) ] ,
56
49
time_stamp : 0 ,
57
- dep_tracking_reads : BitVector :: new ( files. len ( ) ) ,
58
50
}
59
51
}
60
52
@@ -67,9 +59,6 @@ impl<'tcx> CachingCodemapView<'tcx> {
67
59
for cache_entry in self . line_cache . iter_mut ( ) {
68
60
if pos >= cache_entry. line_start && pos < cache_entry. line_end {
69
61
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
- }
73
62
74
63
return Some ( ( cache_entry. file . clone ( ) ,
75
64
cache_entry. line_number ,
@@ -90,7 +79,7 @@ impl<'tcx> CachingCodemapView<'tcx> {
90
79
// If the entry doesn't point to the correct file, fix it up
91
80
if pos < cache_entry. file . start_pos || pos >= cache_entry. file . end_pos {
92
81
let file_valid;
93
- let files = self . codemap . files_untracked ( ) ;
82
+ let files = self . codemap . files ( ) ;
94
83
95
84
if files. len ( ) > 0 {
96
85
let file_index = self . codemap . lookup_filemap_idx ( pos) ;
@@ -120,21 +109,8 @@ impl<'tcx> CachingCodemapView<'tcx> {
120
109
cache_entry. line_end = line_bounds. 1 ;
121
110
cache_entry. time_stamp = self . time_stamp ;
122
111
123
- if self . dep_tracking_reads . insert ( cache_entry. file_index ) {
124
- self . dep_graph . read ( dep_node ( cache_entry) ) ;
125
- }
126
-
127
112
return Some ( ( cache_entry. file . clone ( ) ,
128
113
cache_entry. line_number ,
129
114
pos - cache_entry. line_start ) ) ;
130
115
}
131
116
}
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