@@ -78,13 +78,11 @@ impl Cache {
78
78
}
79
79
}
80
80
81
- #[ inline]
82
81
pub fn invalidate_predecessors ( & mut self ) {
83
82
// FIXME: consider being more fine-grained
84
83
self . predecessors = None ;
85
84
}
86
85
87
- #[ inline]
88
86
pub fn ensure_predecessors ( & mut self , body : & Body < ' _ > ) {
89
87
if self . predecessors . is_none ( ) {
90
88
let mut result = IndexVec :: from_elem ( vec ! [ ] , body. basic_blocks ( ) ) ;
@@ -100,29 +98,24 @@ impl Cache {
100
98
}
101
99
}
102
100
103
- #[ inline]
104
101
/// This will recompute the predecessors cache if it is not available
105
102
fn predecessors ( & mut self , body : & Body < ' _ > ) -> & IndexVec < BasicBlock , Vec < BasicBlock > > {
106
103
self . ensure_predecessors ( body) ;
107
104
self . predecessors . as_ref ( ) . unwrap ( )
108
105
}
109
106
110
- #[ inline]
111
107
fn predecessors_for ( & mut self , bb : BasicBlock , body : & Body < ' _ > ) -> & [ BasicBlock ] {
112
108
& self . predecessors ( body) [ bb]
113
109
}
114
110
115
- #[ inline]
116
111
fn unwrap_predecessors_for ( & self , bb : BasicBlock ) -> & [ BasicBlock ] {
117
112
& self . predecessors . as_ref ( ) . unwrap ( ) [ bb]
118
113
}
119
114
120
- #[ inline]
121
115
impl_predecessor_locations ! ( ( pub ) predecessor_locations mut ) ;
122
116
123
117
impl_predecessor_locations ! ( ( ) unwrap_predecessor_locations) ;
124
118
125
- #[ inline]
126
119
pub fn basic_blocks_mut < ' a , ' tcx > (
127
120
& mut self ,
128
121
body : & ' a mut Body < ' tcx >
@@ -195,7 +188,6 @@ impl BodyCache<'tcx> {
195
188
impl < ' tcx > Index < BasicBlock > for BodyCache < ' tcx > {
196
189
type Output = BasicBlockData < ' tcx > ;
197
190
198
- #[ inline]
199
191
fn index ( & self , index : BasicBlock ) -> & BasicBlockData < ' tcx > {
200
192
& self . body [ index]
201
193
}
@@ -238,32 +230,26 @@ impl ReadOnlyBodyCache<'a, 'tcx> {
238
230
}
239
231
}
240
232
241
- #[ inline]
242
233
pub fn predecessors ( & self ) -> & IndexVec < BasicBlock , Vec < BasicBlock > > {
243
234
self . cache . predecessors . as_ref ( ) . unwrap ( )
244
235
}
245
236
246
- #[ inline]
247
237
pub fn predecessors_for ( & self , bb : BasicBlock ) -> & [ BasicBlock ] {
248
238
self . cache . unwrap_predecessors_for ( bb)
249
239
}
250
240
251
- #[ inline]
252
241
pub fn predecessor_locations ( & self , loc : Location ) -> impl Iterator < Item = Location > + ' _ {
253
242
self . cache . unwrap_predecessor_locations ( loc, self . body )
254
243
}
255
244
256
- #[ inline]
257
245
pub fn body ( & self ) -> & ' a Body < ' tcx > {
258
246
self . body
259
247
}
260
248
261
- #[ inline]
262
249
pub fn basic_blocks ( & self ) -> & IndexVec < BasicBlock , BasicBlockData < ' tcx > > {
263
250
& self . body . basic_blocks
264
251
}
265
252
266
- #[ inline]
267
253
pub fn dominators ( & self ) -> Dominators < BasicBlock > {
268
254
dominators ( self )
269
255
}
@@ -325,7 +311,6 @@ impl Deref for ReadOnlyBodyCache<'a, 'tcx> {
325
311
impl Index < BasicBlock > for ReadOnlyBodyCache < ' a , ' tcx > {
326
312
type Output = BasicBlockData < ' tcx > ;
327
313
328
- #[ inline]
329
314
fn index ( & self , index : BasicBlock ) -> & BasicBlockData < ' tcx > {
330
315
& self . body [ index]
331
316
}
0 commit comments