1
Fork 0

Add codegen for global_asm! sym operands

This commit is contained in:
Amanieu d'Antras 2022-03-01 00:53:25 +00:00
parent dc345d8bff
commit 547405e801
11 changed files with 137 additions and 22 deletions

View file

@ -36,8 +36,10 @@ pub enum InlineAsmOperandRef<'tcx, B: BackendTypes + ?Sized> {
}
#[derive(Debug)]
pub enum GlobalAsmOperandRef {
pub enum GlobalAsmOperandRef<'tcx> {
Const { string: String },
SymFn { instance: Instance<'tcx> },
SymStatic { def_id: DefId },
}
pub trait AsmBuilderMethods<'tcx>: BackendTypes {
@ -53,11 +55,11 @@ pub trait AsmBuilderMethods<'tcx>: BackendTypes {
);
}
pub trait AsmMethods {
pub trait AsmMethods<'tcx> {
fn codegen_global_asm(
&self,
template: &[InlineAsmTemplatePiece],
operands: &[GlobalAsmOperandRef],
operands: &[GlobalAsmOperandRef<'tcx>],
options: InlineAsmOptions,
line_spans: &[Span],
);