1 use super::BackendTypes;
2 use crate::mir::operand::OperandRef;
3 use crate::mir::place::PlaceRef;
4 use rustc_ast::{InlineAsmOptions, InlineAsmTemplatePiece};
5 use rustc_hir::def_id::DefId;
6 use rustc_middle::ty::Instance;
8 use rustc_target::asm::InlineAsmRegOrRegClass;
11 pub enum InlineAsmOperandRef<'tcx, B: BackendTypes + ?Sized> {
13 reg: InlineAsmRegOrRegClass,
14 value: OperandRef<'tcx, B::Value>,
17 reg: InlineAsmRegOrRegClass,
19 place: Option<PlaceRef<'tcx, B::Value>>,
22 reg: InlineAsmRegOrRegClass,
24 in_value: OperandRef<'tcx, B::Value>,
25 out_place: Option<PlaceRef<'tcx, B::Value>>,
31 instance: Instance<'tcx>,
39 pub enum GlobalAsmOperandRef {
40 Const { string: String },
43 pub trait AsmBuilderMethods<'tcx>: BackendTypes {
44 /// Take an inline assembly expression and splat it out via LLVM
45 fn codegen_inline_asm(
47 template: &[InlineAsmTemplatePiece],
48 operands: &[InlineAsmOperandRef<'tcx, Self>],
49 options: InlineAsmOptions,
51 instance: Instance<'_>,
52 dest_catch_funclet: Option<(Self::BasicBlock, Self::BasicBlock, Option<&Self::Funclet>)>,
56 pub trait AsmMethods {
57 fn codegen_global_asm(
59 template: &[InlineAsmTemplatePiece],
60 operands: &[GlobalAsmOperandRef],
61 options: InlineAsmOptions,