@@ -394,6 +394,20 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
394
394
line_spans,
395
395
} ) => {
396
396
use rustc_middle:: { mir, thir} ;
397
+
398
+ let destination_block = this. cfg . start_new_block ( ) ;
399
+ let mut targets = if options. contains ( InlineAsmOptions :: NORETURN ) {
400
+ vec ! [ ]
401
+ } else {
402
+ this. cfg . push_assign_unit (
403
+ destination_block,
404
+ source_info,
405
+ destination,
406
+ this. tcx ,
407
+ ) ;
408
+ vec ! [ destination_block]
409
+ } ;
410
+
397
411
let operands = operands
398
412
. into_iter ( )
399
413
. map ( |op| match * op {
@@ -449,17 +463,24 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
449
463
thir:: InlineAsmOperand :: SymStatic { def_id } => {
450
464
mir:: InlineAsmOperand :: SymStatic { def_id }
451
465
}
452
- thir:: InlineAsmOperand :: Label { .. } => {
453
- todo ! ( )
466
+ thir:: InlineAsmOperand :: Label { block } => {
467
+ let target = this. cfg . start_new_block ( ) ;
468
+ let target_index = targets. len ( ) ;
469
+ targets. push ( target) ;
470
+
471
+ let tmp = this. get_unit_temp ( ) ;
472
+ let target = unpack ! ( this. ast_block( tmp, target, block, source_info) ) ;
473
+ this. cfg . terminate (
474
+ target,
475
+ source_info,
476
+ TerminatorKind :: Goto { target : destination_block } ,
477
+ ) ;
478
+
479
+ mir:: InlineAsmOperand :: Label { target_index }
454
480
}
455
481
} )
456
482
. collect ( ) ;
457
483
458
- if !options. contains ( InlineAsmOptions :: NORETURN ) {
459
- this. cfg . push_assign_unit ( block, source_info, destination, this. tcx ) ;
460
- }
461
-
462
- let destination_block = this. cfg . start_new_block ( ) ;
463
484
this. cfg . terminate (
464
485
block,
465
486
source_info,
@@ -468,11 +489,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
468
489
operands,
469
490
options,
470
491
line_spans,
471
- targets : if options. contains ( InlineAsmOptions :: NORETURN ) {
472
- Vec :: new ( )
473
- } else {
474
- vec ! [ destination_block]
475
- } ,
492
+ targets,
476
493
unwind : if options. contains ( InlineAsmOptions :: MAY_UNWIND ) {
477
494
UnwindAction :: Continue
478
495
} else {
0 commit comments