@@ -3,7 +3,9 @@ use std::cmp;
33use rustc_ast as ast;
44use rustc_ast:: { InlineAsmOptions , InlineAsmTemplatePiece } ;
55use 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+ } ;
79use rustc_middle:: ty:: layout:: { HasTyCtxt , LayoutOf , ValidityRequirement } ;
810use rustc_middle:: ty:: print:: { with_no_trimmed_paths, with_no_visible_paths} ;
911use rustc_middle:: ty:: { self , Instance , Ty } ;
@@ -1156,6 +1158,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
11561158 & mut self ,
11571159 helper : TerminatorCodegenHelper < ' tcx > ,
11581160 bx : & mut Bx ,
1161+ asm_macro : InlineAsmMacro ,
11591162 terminator : & mir:: Terminator < ' tcx > ,
11601163 template : & [ ast:: InlineAsmTemplatePiece ] ,
11611164 operands : & [ mir:: InlineAsmOperand < ' tcx > ] ,
@@ -1226,11 +1229,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
12261229 & operands,
12271230 options,
12281231 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 ( ) } ,
12341233 unwind,
12351234 instance,
12361235 mergeable_succ,
@@ -1406,6 +1405,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
14061405 }
14071406
14081407 mir:: TerminatorKind :: InlineAsm {
1408+ asm_macro,
14091409 template,
14101410 ref operands,
14111411 options,
@@ -1415,6 +1415,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
14151415 } => self . codegen_asm_terminator (
14161416 helper,
14171417 bx,
1418+ asm_macro,
14181419 terminator,
14191420 template,
14201421 operands,
0 commit comments