@@ -358,8 +358,7 @@ impl<'tcx> TerminatorKind<'tcx> {
358
358
| Yield { resume : ref t, drop : Some ( u) , .. }
359
359
| Drop { target : ref t, unwind : UnwindAction :: Cleanup ( u) , .. }
360
360
| Assert { target : ref t, unwind : UnwindAction :: Cleanup ( u) , .. }
361
- | FalseUnwind { real_target : ref t, unwind : UnwindAction :: Cleanup ( u) }
362
- | InlineAsm { destination : Some ( ref t) , unwind : UnwindAction :: Cleanup ( u) , .. } => {
361
+ | FalseUnwind { real_target : ref t, unwind : UnwindAction :: Cleanup ( u) } => {
363
362
slice:: from_ref ( t) . into_iter ( ) . copied ( ) . chain ( Some ( u) )
364
363
}
365
364
Goto { target : ref t }
@@ -368,20 +367,19 @@ impl<'tcx> TerminatorKind<'tcx> {
368
367
| Yield { resume : ref t, drop : None , .. }
369
368
| Drop { target : ref t, unwind : _, .. }
370
369
| Assert { target : ref t, unwind : _, .. }
371
- | FalseUnwind { real_target : ref t, unwind : _ }
372
- | InlineAsm { destination : None , unwind : UnwindAction :: Cleanup ( ref t) , .. }
373
- | InlineAsm { destination : Some ( ref t) , unwind : _, .. } => {
370
+ | FalseUnwind { real_target : ref t, unwind : _ } => {
374
371
slice:: from_ref ( t) . into_iter ( ) . copied ( ) . chain ( None )
375
372
}
376
373
UnwindResume
377
374
| UnwindTerminate ( _)
378
375
| CoroutineDrop
379
376
| Return
380
377
| Unreachable
381
- | Call { target : None , unwind : _, .. }
382
- | InlineAsm { destination : None , unwind : _ , .. } => {
383
- ( & [ ] ) . into_iter ( ) . copied ( ) . chain ( None )
378
+ | Call { target : None , unwind : _, .. } => ( & [ ] ) . into_iter ( ) . copied ( ) . chain ( None ) ,
379
+ InlineAsm { ref targets , unwind : UnwindAction :: Cleanup ( u ) , .. } => {
380
+ targets . iter ( ) . copied ( ) . chain ( Some ( u ) )
384
381
}
382
+ InlineAsm { ref targets, unwind : _, .. } => targets. iter ( ) . copied ( ) . chain ( None ) ,
385
383
SwitchInt { ref targets, .. } => targets. targets . iter ( ) . copied ( ) . chain ( None ) ,
386
384
FalseEdge { ref real_target, imaginary_target } => {
387
385
slice:: from_ref ( real_target) . into_iter ( ) . copied ( ) . chain ( Some ( imaginary_target) )
@@ -396,30 +394,28 @@ impl<'tcx> TerminatorKind<'tcx> {
396
394
| Yield { resume : ref mut t, drop : Some ( ref mut u) , .. }
397
395
| Drop { target : ref mut t, unwind : UnwindAction :: Cleanup ( ref mut u) , .. }
398
396
| Assert { target : ref mut t, unwind : UnwindAction :: Cleanup ( ref mut u) , .. }
399
- | FalseUnwind { real_target : ref mut t, unwind : UnwindAction :: Cleanup ( ref mut u) }
400
- | InlineAsm {
401
- destination : Some ( ref mut t) ,
402
- unwind : UnwindAction :: Cleanup ( ref mut u) ,
403
- ..
404
- } => slice:: from_mut ( t) . into_iter ( ) . chain ( Some ( u) ) ,
397
+ | FalseUnwind { real_target : ref mut t, unwind : UnwindAction :: Cleanup ( ref mut u) } => {
398
+ slice:: from_mut ( t) . into_iter ( ) . chain ( Some ( u) )
399
+ }
405
400
Goto { target : ref mut t }
406
401
| Call { target : None , unwind : UnwindAction :: Cleanup ( ref mut t) , .. }
407
402
| Call { target : Some ( ref mut t) , unwind : _, .. }
408
403
| Yield { resume : ref mut t, drop : None , .. }
409
404
| Drop { target : ref mut t, unwind : _, .. }
410
405
| Assert { target : ref mut t, unwind : _, .. }
411
- | FalseUnwind { real_target : ref mut t, unwind : _ }
412
- | InlineAsm { destination : None , unwind : UnwindAction :: Cleanup ( ref mut t) , .. }
413
- | InlineAsm { destination : Some ( ref mut t) , unwind : _, .. } => {
406
+ | FalseUnwind { real_target : ref mut t, unwind : _ } => {
414
407
slice:: from_mut ( t) . into_iter ( ) . chain ( None )
415
408
}
416
409
UnwindResume
417
410
| UnwindTerminate ( _)
418
411
| CoroutineDrop
419
412
| Return
420
413
| Unreachable
421
- | Call { target : None , unwind : _, .. }
422
- | InlineAsm { destination : None , unwind : _, .. } => ( & mut [ ] ) . into_iter ( ) . chain ( None ) ,
414
+ | Call { target : None , unwind : _, .. } => ( & mut [ ] ) . into_iter ( ) . chain ( None ) ,
415
+ InlineAsm { ref mut targets, unwind : UnwindAction :: Cleanup ( ref mut u) , .. } => {
416
+ targets. iter_mut ( ) . chain ( Some ( u) )
417
+ }
418
+ InlineAsm { ref mut targets, unwind : _, .. } => targets. iter_mut ( ) . chain ( None ) ,
423
419
SwitchInt { ref mut targets, .. } => targets. targets . iter_mut ( ) . chain ( None ) ,
424
420
FalseEdge { ref mut real_target, ref mut imaginary_target } => {
425
421
slice:: from_mut ( real_target) . into_iter ( ) . chain ( Some ( imaginary_target) )
@@ -495,6 +491,12 @@ pub enum TerminatorEdges<'mir, 'tcx> {
495
491
cleanup : Option < BasicBlock > ,
496
492
place : CallReturnPlaces < ' mir , ' tcx > ,
497
493
} ,
494
+ /// Special action for `InlineAsm` terminators.
495
+ InlineAsm {
496
+ targets : & ' mir [ BasicBlock ] ,
497
+ cleanup : Option < BasicBlock > ,
498
+ place : CallReturnPlaces < ' mir , ' tcx > ,
499
+ } ,
498
500
/// Special edge for `SwitchInt`.
499
501
SwitchInt { targets : & ' mir SwitchTargets , discr : & ' mir Operand < ' tcx > } ,
500
502
}
@@ -575,10 +577,10 @@ impl<'tcx> TerminatorKind<'tcx> {
575
577
ref operands,
576
578
options : _,
577
579
line_spans : _,
578
- destination ,
580
+ ref targets ,
579
581
unwind,
580
- } => TerminatorEdges :: AssignOnReturn {
581
- return_ : destination ,
582
+ } => TerminatorEdges :: InlineAsm {
583
+ targets ,
582
584
cleanup : unwind. cleanup_block ( ) ,
583
585
place : CallReturnPlaces :: InlineAsm ( operands) ,
584
586
} ,
0 commit comments