@@ -3,7 +3,9 @@ use std::cmp;
3
3
use rustc_ast as ast;
4
4
use rustc_ast:: { InlineAsmOptions , InlineAsmTemplatePiece } ;
5
5
use rustc_hir:: lang_items:: LangItem ;
6
- use rustc_middle:: mir:: { self , AssertKind , BasicBlock , SwitchTargets , UnwindTerminateReason } ;
6
+ use rustc_middle:: mir:: {
7
+ self , AssertKind , BasicBlock , InlineAsmMacro , SwitchTargets , UnwindTerminateReason ,
8
+ } ;
7
9
use rustc_middle:: ty:: layout:: { HasTyCtxt , LayoutOf , ValidityRequirement } ;
8
10
use rustc_middle:: ty:: print:: { with_no_trimmed_paths, with_no_visible_paths} ;
9
11
use rustc_middle:: ty:: { self , Instance , Ty } ;
@@ -1156,6 +1158,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
1156
1158
& mut self ,
1157
1159
helper : TerminatorCodegenHelper < ' tcx > ,
1158
1160
bx : & mut Bx ,
1161
+ asm_macro : InlineAsmMacro ,
1159
1162
terminator : & mir:: Terminator < ' tcx > ,
1160
1163
template : & [ ast:: InlineAsmTemplatePiece ] ,
1161
1164
operands : & [ mir:: InlineAsmOperand < ' tcx > ] ,
@@ -1226,11 +1229,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
1226
1229
& operands,
1227
1230
options,
1228
1231
line_spans,
1229
- if options. contains ( InlineAsmOptions :: NORETURN ) {
1230
- None
1231
- } else {
1232
- targets. get ( 0 ) . copied ( )
1233
- } ,
1232
+ if asm_macro. diverges ( options) { None } else { targets. get ( 0 ) . copied ( ) } ,
1234
1233
unwind,
1235
1234
instance,
1236
1235
mergeable_succ,
@@ -1406,6 +1405,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
1406
1405
}
1407
1406
1408
1407
mir:: TerminatorKind :: InlineAsm {
1408
+ asm_macro,
1409
1409
template,
1410
1410
ref operands,
1411
1411
options,
@@ -1415,6 +1415,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
1415
1415
} => self . codegen_asm_terminator (
1416
1416
helper,
1417
1417
bx,
1418
+ asm_macro,
1418
1419
terminator,
1419
1420
template,
1420
1421
operands,
0 commit comments