Reimplement lowering of sym operands for asm! so that it also works with global_asm!

This commit is contained in:
Amanieu d'Antras 2022-03-01 00:50:56 +00:00
parent f9d4d12b6a
commit dc345d8bff
28 changed files with 400 additions and 163 deletions

View file

@ -2425,8 +2425,12 @@ pub enum InlineAsmOperand<'hir> {
Const {
anon_const: AnonConst,
},
Sym {
expr: Expr<'hir>,
SymFn {
anon_const: AnonConst,
},
SymStatic {
path: QPath<'hir>,
def_id: DefId,
},
}
@ -2437,7 +2441,7 @@ impl<'hir> InlineAsmOperand<'hir> {
| Self::Out { reg, .. }
| Self::InOut { reg, .. }
| Self::SplitInOut { reg, .. } => Some(reg),
Self::Const { .. } | Self::Sym { .. } => None,
Self::Const { .. } | Self::SymFn { .. } | Self::SymStatic { .. } => None,
}
}