@@ -78,13 +78,11 @@ impl Cache {
7878 }
7979 }
8080
81- #[ inline]
8281 pub fn invalidate_predecessors ( & mut self ) {
8382 // FIXME: consider being more fine-grained
8483 self . predecessors = None ;
8584 }
8685
87- #[ inline]
8886 pub fn ensure_predecessors ( & mut self , body : & Body < ' _ > ) {
8987 if self . predecessors . is_none ( ) {
9088 let mut result = IndexVec :: from_elem ( vec ! [ ] , body. basic_blocks ( ) ) ;
@@ -100,29 +98,24 @@ impl Cache {
10098 }
10199 }
102100
103- #[ inline]
104101 /// This will recompute the predecessors cache if it is not available
105102 fn predecessors ( & mut self , body : & Body < ' _ > ) -> & IndexVec < BasicBlock , Vec < BasicBlock > > {
106103 self . ensure_predecessors ( body) ;
107104 self . predecessors . as_ref ( ) . unwrap ( )
108105 }
109106
110- #[ inline]
111107 fn predecessors_for ( & mut self , bb : BasicBlock , body : & Body < ' _ > ) -> & [ BasicBlock ] {
112108 & self . predecessors ( body) [ bb]
113109 }
114110
115- #[ inline]
116111 fn unwrap_predecessors_for ( & self , bb : BasicBlock ) -> & [ BasicBlock ] {
117112 & self . predecessors . as_ref ( ) . unwrap ( ) [ bb]
118113 }
119114
120- #[ inline]
121115 impl_predecessor_locations ! ( ( pub ) predecessor_locations mut ) ;
122116
123117 impl_predecessor_locations ! ( ( ) unwrap_predecessor_locations) ;
124118
125- #[ inline]
126119 pub fn basic_blocks_mut < ' a , ' tcx > (
127120 & mut self ,
128121 body : & ' a mut Body < ' tcx >
@@ -195,7 +188,6 @@ impl BodyCache<'tcx> {
195188impl < ' tcx > Index < BasicBlock > for BodyCache < ' tcx > {
196189 type Output = BasicBlockData < ' tcx > ;
197190
198- #[ inline]
199191 fn index ( & self , index : BasicBlock ) -> & BasicBlockData < ' tcx > {
200192 & self . body [ index]
201193 }
@@ -238,32 +230,26 @@ impl ReadOnlyBodyCache<'a, 'tcx> {
238230 }
239231 }
240232
241- #[ inline]
242233 pub fn predecessors ( & self ) -> & IndexVec < BasicBlock , Vec < BasicBlock > > {
243234 self . cache . predecessors . as_ref ( ) . unwrap ( )
244235 }
245236
246- #[ inline]
247237 pub fn predecessors_for ( & self , bb : BasicBlock ) -> & [ BasicBlock ] {
248238 self . cache . unwrap_predecessors_for ( bb)
249239 }
250240
251- #[ inline]
252241 pub fn predecessor_locations ( & self , loc : Location ) -> impl Iterator < Item = Location > + ' _ {
253242 self . cache . unwrap_predecessor_locations ( loc, self . body )
254243 }
255244
256- #[ inline]
257245 pub fn body ( & self ) -> & ' a Body < ' tcx > {
258246 self . body
259247 }
260248
261- #[ inline]
262249 pub fn basic_blocks ( & self ) -> & IndexVec < BasicBlock , BasicBlockData < ' tcx > > {
263250 & self . body . basic_blocks
264251 }
265252
266- #[ inline]
267253 pub fn dominators ( & self ) -> Dominators < BasicBlock > {
268254 dominators ( self )
269255 }
@@ -325,7 +311,6 @@ impl Deref for ReadOnlyBodyCache<'a, 'tcx> {
325311impl Index < BasicBlock > for ReadOnlyBodyCache < ' a , ' tcx > {
326312 type Output = BasicBlockData < ' tcx > ;
327313
328- #[ inline]
329314 fn index ( & self , index : BasicBlock ) -> & BasicBlockData < ' tcx > {
330315 & self . body [ index]
331316 }
0 commit comments