1
Fork 0

Change InlineAsm to allow multiple targets instead

This commit is contained in:
Gary Guo 2023-12-26 15:28:42 +00:00
parent 7152993aa8
commit b044aaa905
23 changed files with 125 additions and 96 deletions

View file

@ -474,10 +474,10 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
operands,
options,
line_spans,
destination: if options.contains(InlineAsmOptions::NORETURN) {
None
targets: if options.contains(InlineAsmOptions::NORETURN) {
Vec::new()
} else {
Some(destination_block)
vec![destination_block]
},
unwind: if options.contains(InlineAsmOptions::MAY_UNWIND) {
UnwindAction::Continue

View file

@ -199,9 +199,10 @@ impl<'mir, 'tcx, C: TerminatorClassifier<'tcx>> TriColorVisitor<BasicBlocks<'tcx
| TerminatorKind::Unreachable
| TerminatorKind::Yield { .. } => ControlFlow::Break(NonRecursive),
// A diverging InlineAsm is treated as non-recursing
TerminatorKind::InlineAsm { destination, .. } => {
if destination.is_some() {
// A InlineAsm without targets (diverging and contains no labels)
// is treated as non-recursing.
TerminatorKind::InlineAsm { ref targets, .. } => {
if !targets.is_empty() {
ControlFlow::Continue(())
} else {
ControlFlow::Break(NonRecursive)