1
Fork 0

Implement asm goto in MIR and MIR lowering

This commit is contained in:
Gary Guo 2023-12-26 16:07:35 +00:00
parent b044aaa905
commit 3b1dd1bfa9
13 changed files with 53 additions and 17 deletions

View file

@ -830,6 +830,9 @@ impl<'tcx> TerminatorKind<'tcx> {
InlineAsmOperand::SymStatic { def_id } => {
write!(fmt, "sym_static {def_id:?}")?;
}
InlineAsmOperand::Label { target_index } => {
write!(fmt, "label {target_index}")?;
}
}
}
write!(fmt, ", options({options:?}))")

View file

@ -919,6 +919,10 @@ pub enum InlineAsmOperand<'tcx> {
SymStatic {
def_id: DefId,
},
Label {
/// This represents the index into the `targets` array in `TerminatorKind::InlineAsm`.
target_index: usize,
},
}
/// Type for MIR `Assert` terminator error messages.

View file

@ -595,7 +595,8 @@ macro_rules! make_mir_visitor {
self.visit_constant(value, location);
}
InlineAsmOperand::Out { place: None, .. }
| InlineAsmOperand::SymStatic { def_id: _ } => {}
| InlineAsmOperand::SymStatic { def_id: _ }
| InlineAsmOperand::Label { target_index: _ } => {}
}
}
}