Name explicit registers in conflict register errors for inline assembly
This commit is contained in:
parent
a6b8ae582a
commit
e0bfb615da
6 changed files with 43 additions and 22 deletions
|
@ -2237,6 +2237,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");`.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue