1
Fork 0

Auto merge of #117912 - GeorgeWort:master, r=petrochenkov

Name explicit registers in conflict register errors for inline assembly
This commit is contained in:
bors 2023-12-02 13:38:47 +00:00
commit 4e3dc976e7
6 changed files with 43 additions and 22 deletions

View file

@ -2251,6 +2251,18 @@ pub enum InlineAsmOperand {
},
}
impl InlineAsmOperand {
pub fn reg(&self) -> Option<&InlineAsmRegOrRegClass> {
match self {
Self::In { reg, .. }
| Self::Out { reg, .. }
| Self::InOut { reg, .. }
| Self::SplitInOut { reg, .. } => Some(reg),
Self::Const { .. } | Self::Sym { .. } => None,
}
}
}
/// Inline assembly.
///
/// E.g., `asm!("NOP");`.