@@ -96,13 +96,13 @@ where
96
96
// the value with `None`, move it into the results cursor, move it
97
97
// back out, and return it to the refcell wrapped in `Some`.
98
98
let mut fmt = BlockFormatter {
99
- results : results. take ( ) . unwrap ( ) . into_results_cursor ( self . body ) ,
99
+ cursor : results. take ( ) . unwrap ( ) . into_results_cursor ( self . body ) ,
100
100
style : self . style ,
101
101
bg : Background :: Light ,
102
102
} ;
103
103
104
104
fmt. write_node_label ( & mut label, * block) . unwrap ( ) ;
105
- Some ( fmt. results . into_results ( ) )
105
+ Some ( fmt. cursor . into_results ( ) )
106
106
} ) ;
107
107
dot:: LabelText :: html ( String :: from_utf8 ( label) . unwrap ( ) )
108
108
}
@@ -155,7 +155,7 @@ struct BlockFormatter<'mir, 'tcx, A>
155
155
where
156
156
A : Analysis < ' tcx > ,
157
157
{
158
- results : ResultsCursor < ' mir , ' tcx , A > ,
158
+ cursor : ResultsCursor < ' mir , ' tcx , A > ,
159
159
bg : Background ,
160
160
style : OutputStyle ,
161
161
}
@@ -219,21 +219,21 @@ where
219
219
220
220
// C: State at start of block
221
221
self . bg = Background :: Light ;
222
- self . results . seek_to_block_start ( block) ;
223
- let block_start_state = self . results . get ( ) . clone ( ) ;
222
+ self . cursor . seek_to_block_start ( block) ;
223
+ let block_start_state = self . cursor . get ( ) . clone ( ) ;
224
224
self . write_row_with_full_state ( w, "" , "(on start)" ) ?;
225
225
226
226
// D + E: Statement and terminator transfer functions
227
227
self . write_statements_and_terminator ( w, block) ?;
228
228
229
229
// F: State at end of block
230
230
231
- let terminator = self . results . body ( ) [ block] . terminator ( ) ;
231
+ let terminator = self . cursor . body ( ) [ block] . terminator ( ) ;
232
232
233
233
// Write the full dataflow state immediately after the terminator if it differs from the
234
234
// state at block entry.
235
- self . results . seek_to_block_end ( block) ;
236
- if self . results . get ( ) != & block_start_state || A :: Direction :: IS_BACKWARD {
235
+ self . cursor . seek_to_block_end ( block) ;
236
+ if self . cursor . get ( ) != & block_start_state || A :: Direction :: IS_BACKWARD {
237
237
let after_terminator_name = match terminator. kind {
238
238
mir:: TerminatorKind :: Call { target : Some ( _) , .. } => "(on unwind)" ,
239
239
_ => "(on end)" ,
@@ -250,8 +250,8 @@ where
250
250
match terminator. kind {
251
251
mir:: TerminatorKind :: Call { destination, .. } => {
252
252
self . write_row ( w, "" , "(on successful return)" , |this, w, fmt| {
253
- let state_on_unwind = this. results . get ( ) . clone ( ) ;
254
- this. results . apply_custom_effect ( |analysis, state| {
253
+ let state_on_unwind = this. cursor . get ( ) . clone ( ) ;
254
+ this. cursor . apply_custom_effect ( |analysis, state| {
255
255
analysis. apply_call_return_effect (
256
256
state,
257
257
block,
@@ -265,18 +265,18 @@ where
265
265
colspan = this. style. num_state_columns( ) ,
266
266
fmt = fmt,
267
267
diff = diff_pretty(
268
- this. results . get( ) ,
268
+ this. cursor . get( ) ,
269
269
& state_on_unwind,
270
- this. results . analysis( )
270
+ this. cursor . analysis( )
271
271
) ,
272
272
)
273
273
} ) ?;
274
274
}
275
275
276
276
mir:: TerminatorKind :: Yield { resume, resume_arg, .. } => {
277
277
self . write_row ( w, "" , "(on yield resume)" , |this, w, fmt| {
278
- let state_on_coroutine_drop = this. results . get ( ) . clone ( ) ;
279
- this. results . apply_custom_effect ( |analysis, state| {
278
+ let state_on_coroutine_drop = this. cursor . get ( ) . clone ( ) ;
279
+ this. cursor . apply_custom_effect ( |analysis, state| {
280
280
analysis. apply_call_return_effect (
281
281
state,
282
282
resume,
@@ -290,9 +290,9 @@ where
290
290
colspan = this. style. num_state_columns( ) ,
291
291
fmt = fmt,
292
292
diff = diff_pretty(
293
- this. results . get( ) ,
293
+ this. cursor . get( ) ,
294
294
& state_on_coroutine_drop,
295
- this. results . analysis( )
295
+ this. cursor . analysis( )
296
296
) ,
297
297
)
298
298
} ) ?;
@@ -302,8 +302,8 @@ where
302
302
if !targets. is_empty ( ) =>
303
303
{
304
304
self . write_row ( w, "" , "(on successful return)" , |this, w, fmt| {
305
- let state_on_unwind = this. results . get ( ) . clone ( ) ;
306
- this. results . apply_custom_effect ( |analysis, state| {
305
+ let state_on_unwind = this. cursor . get ( ) . clone ( ) ;
306
+ this. cursor . apply_custom_effect ( |analysis, state| {
307
307
analysis. apply_call_return_effect (
308
308
state,
309
309
block,
@@ -317,9 +317,9 @@ where
317
317
colspan = this. style. num_state_columns( ) ,
318
318
fmt = fmt,
319
319
diff = diff_pretty(
320
- this. results . get( ) ,
320
+ this. cursor . get( ) ,
321
321
& state_on_unwind,
322
- this. results . analysis( )
322
+ this. cursor . analysis( )
323
323
) ,
324
324
)
325
325
} ) ?;
@@ -407,7 +407,7 @@ where
407
407
block : BasicBlock ,
408
408
) -> io:: Result < ( ) > {
409
409
let diffs =
410
- StateDiffCollector :: run ( self . results . body ( ) , block, self . results . results ( ) , self . style ) ;
410
+ StateDiffCollector :: run ( self . cursor . body ( ) , block, self . cursor . results ( ) , self . style ) ;
411
411
412
412
let mut diffs_before = diffs. before . map ( |v| v. into_iter ( ) ) ;
413
413
let mut diffs_after = diffs. after . into_iter ( ) ;
@@ -416,7 +416,7 @@ where
416
416
if A :: Direction :: IS_FORWARD { it. next ( ) . unwrap ( ) } else { it. next_back ( ) . unwrap ( ) }
417
417
} ;
418
418
419
- for ( i, statement) in self . results . body ( ) [ block] . statements . iter ( ) . enumerate ( ) {
419
+ for ( i, statement) in self . cursor . body ( ) [ block] . statements . iter ( ) . enumerate ( ) {
420
420
let statement_str = format ! ( "{statement:?}" ) ;
421
421
let index_str = format ! ( "{i}" ) ;
422
422
@@ -438,7 +438,7 @@ where
438
438
assert ! ( diffs_after. is_empty( ) ) ;
439
439
assert ! ( diffs_before. as_ref( ) . map_or( true , ExactSizeIterator :: is_empty) ) ;
440
440
441
- let terminator = self . results . body ( ) [ block] . terminator ( ) ;
441
+ let terminator = self . cursor . body ( ) [ block] . terminator ( ) ;
442
442
let mut terminator_str = String :: new ( ) ;
443
443
terminator. kind . fmt_head ( & mut terminator_str) . unwrap ( ) ;
444
444
@@ -488,8 +488,8 @@ where
488
488
mir : & str ,
489
489
) -> io:: Result < ( ) > {
490
490
self . write_row ( w, i, mir, |this, w, fmt| {
491
- let state = this. results . get ( ) ;
492
- let analysis = this. results . analysis ( ) ;
491
+ let state = this. cursor . get ( ) ;
492
+ let analysis = this. cursor . analysis ( ) ;
493
493
494
494
// FIXME: The full state vector can be quite long. It would be nice to split on commas
495
495
// and use some text wrapping algorithm.
0 commit comments