@@ -66,12 +66,12 @@ impl Direction for Backward {
66
66
{
67
67
let terminator = block_data. terminator ( ) ;
68
68
let location = Location { block, statement_index : block_data. statements . len ( ) } ;
69
- analysis. apply_before_terminator_effect ( state, terminator, location) ;
70
- analysis. apply_terminator_effect ( state, terminator, location) ;
69
+ analysis. apply_early_terminator_effect ( state, terminator, location) ;
70
+ analysis. apply_primary_terminator_effect ( state, terminator, location) ;
71
71
for ( statement_index, statement) in block_data. statements . iter ( ) . enumerate ( ) . rev ( ) {
72
72
let location = Location { block, statement_index } ;
73
- analysis. apply_before_statement_effect ( state, statement, location) ;
74
- analysis. apply_statement_effect ( state, statement, location) ;
73
+ analysis. apply_early_statement_effect ( state, statement, location) ;
74
+ analysis. apply_primary_statement_effect ( state, statement, location) ;
75
75
}
76
76
77
77
let exit_state = state;
@@ -159,14 +159,14 @@ impl Direction for Backward {
159
159
let location = Location { block, statement_index : from. statement_index } ;
160
160
let terminator = block_data. terminator ( ) ;
161
161
162
- if from. effect == Effect :: Before {
163
- analysis. apply_before_terminator_effect ( state, terminator, location) ;
164
- if to == Effect :: Before . at_index ( terminator_index) {
162
+ if from. effect == Effect :: Early {
163
+ analysis. apply_early_terminator_effect ( state, terminator, location) ;
164
+ if to == Effect :: Early . at_index ( terminator_index) {
165
165
return ;
166
166
}
167
167
}
168
168
169
- analysis. apply_terminator_effect ( state, terminator, location) ;
169
+ analysis. apply_primary_terminator_effect ( state, terminator, location) ;
170
170
if to == Effect :: Primary . at_index ( terminator_index) {
171
171
return ;
172
172
}
@@ -180,37 +180,37 @@ impl Direction for Backward {
180
180
let location = Location { block, statement_index : from. statement_index } ;
181
181
let statement = & block_data. statements [ from. statement_index ] ;
182
182
183
- analysis. apply_statement_effect ( state, statement, location) ;
183
+ analysis. apply_primary_statement_effect ( state, statement, location) ;
184
184
if to == Effect :: Primary . at_index ( from. statement_index ) {
185
185
return ;
186
186
}
187
187
188
188
from. statement_index - 1
189
189
}
190
190
191
- Effect :: Before => from. statement_index ,
191
+ Effect :: Early => from. statement_index ,
192
192
} ;
193
193
194
194
// Handle all statements between `first_unapplied_idx` and `to.statement_index`.
195
195
196
196
for statement_index in ( to. statement_index ..next_effect) . rev ( ) . map ( |i| i + 1 ) {
197
197
let location = Location { block, statement_index } ;
198
198
let statement = & block_data. statements [ statement_index] ;
199
- analysis. apply_before_statement_effect ( state, statement, location) ;
200
- analysis. apply_statement_effect ( state, statement, location) ;
199
+ analysis. apply_early_statement_effect ( state, statement, location) ;
200
+ analysis. apply_primary_statement_effect ( state, statement, location) ;
201
201
}
202
202
203
203
// Handle the statement at `to`.
204
204
205
205
let location = Location { block, statement_index : to. statement_index } ;
206
206
let statement = & block_data. statements [ to. statement_index ] ;
207
- analysis. apply_before_statement_effect ( state, statement, location) ;
207
+ analysis. apply_early_statement_effect ( state, statement, location) ;
208
208
209
- if to. effect == Effect :: Before {
209
+ if to. effect == Effect :: Early {
210
210
return ;
211
211
}
212
212
213
- analysis. apply_statement_effect ( state, statement, location) ;
213
+ analysis. apply_primary_statement_effect ( state, statement, location) ;
214
214
}
215
215
216
216
fn visit_results_in_block < ' mir , ' tcx , A > (
@@ -228,17 +228,17 @@ impl Direction for Backward {
228
228
229
229
let loc = Location { block, statement_index : block_data. statements . len ( ) } ;
230
230
let term = block_data. terminator ( ) ;
231
- results. analysis . apply_before_terminator_effect ( state, term, loc) ;
232
- vis. visit_terminator_before_primary_effect ( results, state, term, loc) ;
233
- results. analysis . apply_terminator_effect ( state, term, loc) ;
234
- vis. visit_terminator_after_primary_effect ( results, state, term, loc) ;
231
+ results. analysis . apply_early_terminator_effect ( state, term, loc) ;
232
+ vis. visit_after_early_terminator_effect ( results, state, term, loc) ;
233
+ results. analysis . apply_primary_terminator_effect ( state, term, loc) ;
234
+ vis. visit_after_primary_terminator_effect ( results, state, term, loc) ;
235
235
236
236
for ( statement_index, stmt) in block_data. statements . iter ( ) . enumerate ( ) . rev ( ) {
237
237
let loc = Location { block, statement_index } ;
238
- results. analysis . apply_before_statement_effect ( state, stmt, loc) ;
239
- vis. visit_statement_before_primary_effect ( results, state, stmt, loc) ;
240
- results. analysis . apply_statement_effect ( state, stmt, loc) ;
241
- vis. visit_statement_after_primary_effect ( results, state, stmt, loc) ;
238
+ results. analysis . apply_early_statement_effect ( state, stmt, loc) ;
239
+ vis. visit_after_early_statement_effect ( results, state, stmt, loc) ;
240
+ results. analysis . apply_primary_statement_effect ( state, stmt, loc) ;
241
+ vis. visit_after_primary_statement_effect ( results, state, stmt, loc) ;
242
242
}
243
243
244
244
vis. visit_block_start ( state) ;
@@ -294,13 +294,13 @@ impl Direction for Forward {
294
294
{
295
295
for ( statement_index, statement) in block_data. statements . iter ( ) . enumerate ( ) {
296
296
let location = Location { block, statement_index } ;
297
- analysis. apply_before_statement_effect ( state, statement, location) ;
298
- analysis. apply_statement_effect ( state, statement, location) ;
297
+ analysis. apply_early_statement_effect ( state, statement, location) ;
298
+ analysis. apply_primary_statement_effect ( state, statement, location) ;
299
299
}
300
300
let terminator = block_data. terminator ( ) ;
301
301
let location = Location { block, statement_index : block_data. statements . len ( ) } ;
302
- analysis. apply_before_terminator_effect ( state, terminator, location) ;
303
- let edges = analysis. apply_terminator_effect ( state, terminator, location) ;
302
+ analysis. apply_early_terminator_effect ( state, terminator, location) ;
303
+ let edges = analysis. apply_primary_terminator_effect ( state, terminator, location) ;
304
304
305
305
let exit_state = state;
306
306
match edges {
@@ -368,21 +368,21 @@ impl Direction for Forward {
368
368
// after effect, do so now and start the loop below from the next statement.
369
369
370
370
let first_unapplied_index = match from. effect {
371
- Effect :: Before => from. statement_index ,
371
+ Effect :: Early => from. statement_index ,
372
372
373
373
Effect :: Primary if from. statement_index == terminator_index => {
374
374
debug_assert_eq ! ( from, to) ;
375
375
376
376
let location = Location { block, statement_index : terminator_index } ;
377
377
let terminator = block_data. terminator ( ) ;
378
- analysis. apply_terminator_effect ( state, terminator, location) ;
378
+ analysis. apply_primary_terminator_effect ( state, terminator, location) ;
379
379
return ;
380
380
}
381
381
382
382
Effect :: Primary => {
383
383
let location = Location { block, statement_index : from. statement_index } ;
384
384
let statement = & block_data. statements [ from. statement_index ] ;
385
- analysis. apply_statement_effect ( state, statement, location) ;
385
+ analysis. apply_primary_statement_effect ( state, statement, location) ;
386
386
387
387
// If we only needed to apply the after effect of the statement at `idx`, we are
388
388
// done.
@@ -399,26 +399,26 @@ impl Direction for Forward {
399
399
for statement_index in first_unapplied_index..to. statement_index {
400
400
let location = Location { block, statement_index } ;
401
401
let statement = & block_data. statements [ statement_index] ;
402
- analysis. apply_before_statement_effect ( state, statement, location) ;
403
- analysis. apply_statement_effect ( state, statement, location) ;
402
+ analysis. apply_early_statement_effect ( state, statement, location) ;
403
+ analysis. apply_primary_statement_effect ( state, statement, location) ;
404
404
}
405
405
406
406
// Handle the statement or terminator at `to`.
407
407
408
408
let location = Location { block, statement_index : to. statement_index } ;
409
409
if to. statement_index == terminator_index {
410
410
let terminator = block_data. terminator ( ) ;
411
- analysis. apply_before_terminator_effect ( state, terminator, location) ;
411
+ analysis. apply_early_terminator_effect ( state, terminator, location) ;
412
412
413
413
if to. effect == Effect :: Primary {
414
- analysis. apply_terminator_effect ( state, terminator, location) ;
414
+ analysis. apply_primary_terminator_effect ( state, terminator, location) ;
415
415
}
416
416
} else {
417
417
let statement = & block_data. statements [ to. statement_index ] ;
418
- analysis. apply_before_statement_effect ( state, statement, location) ;
418
+ analysis. apply_early_statement_effect ( state, statement, location) ;
419
419
420
420
if to. effect == Effect :: Primary {
421
- analysis. apply_statement_effect ( state, statement, location) ;
421
+ analysis. apply_primary_statement_effect ( state, statement, location) ;
422
422
}
423
423
}
424
424
}
@@ -438,18 +438,18 @@ impl Direction for Forward {
438
438
439
439
for ( statement_index, stmt) in block_data. statements . iter ( ) . enumerate ( ) {
440
440
let loc = Location { block, statement_index } ;
441
- results. analysis . apply_before_statement_effect ( state, stmt, loc) ;
442
- vis. visit_statement_before_primary_effect ( results, state, stmt, loc) ;
443
- results. analysis . apply_statement_effect ( state, stmt, loc) ;
444
- vis. visit_statement_after_primary_effect ( results, state, stmt, loc) ;
441
+ results. analysis . apply_early_statement_effect ( state, stmt, loc) ;
442
+ vis. visit_after_early_statement_effect ( results, state, stmt, loc) ;
443
+ results. analysis . apply_primary_statement_effect ( state, stmt, loc) ;
444
+ vis. visit_after_primary_statement_effect ( results, state, stmt, loc) ;
445
445
}
446
446
447
447
let loc = Location { block, statement_index : block_data. statements . len ( ) } ;
448
448
let term = block_data. terminator ( ) ;
449
- results. analysis . apply_before_terminator_effect ( state, term, loc) ;
450
- vis. visit_terminator_before_primary_effect ( results, state, term, loc) ;
451
- results. analysis . apply_terminator_effect ( state, term, loc) ;
452
- vis. visit_terminator_after_primary_effect ( results, state, term, loc) ;
449
+ results. analysis . apply_early_terminator_effect ( state, term, loc) ;
450
+ vis. visit_after_early_terminator_effect ( results, state, term, loc) ;
451
+ results. analysis . apply_primary_terminator_effect ( state, term, loc) ;
452
+ vis. visit_after_primary_terminator_effect ( results, state, term, loc) ;
453
453
454
454
vis. visit_block_end ( state) ;
455
455
}
0 commit comments