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_hir
::LlvmInlineAsmInner
;
7 use rustc_middle
::ty
::Instance
;
9 use rustc_target
::asm
::InlineAsmRegOrRegClass
;
12 pub enum InlineAsmOperandRef
<'tcx
, B
: BackendTypes
+ ?Sized
> {
14 reg
: InlineAsmRegOrRegClass
,
15 value
: OperandRef
<'tcx
, B
::Value
>,
18 reg
: InlineAsmRegOrRegClass
,
20 place
: Option
<PlaceRef
<'tcx
, B
::Value
>>,
23 reg
: InlineAsmRegOrRegClass
,
25 in_value
: OperandRef
<'tcx
, B
::Value
>,
26 out_place
: Option
<PlaceRef
<'tcx
, B
::Value
>>,
32 instance
: Instance
<'tcx
>,
40 pub enum GlobalAsmOperandRef
{
41 Const { string: String }
,
44 pub trait AsmBuilderMethods
<'tcx
>: BackendTypes
{
45 /// Take an inline assembly expression and splat it out via LLVM
46 fn codegen_llvm_inline_asm(
48 ia
: &LlvmInlineAsmInner
,
49 outputs
: Vec
<PlaceRef
<'tcx
, Self::Value
>>,
50 inputs
: Vec
<Self::Value
>,
54 /// Take an inline assembly expression and splat it out via LLVM
55 fn codegen_inline_asm(
57 template
: &[InlineAsmTemplatePiece
],
58 operands
: &[InlineAsmOperandRef
<'tcx
, Self>],
59 options
: InlineAsmOptions
,
64 pub trait AsmMethods
{
65 fn codegen_global_asm(
67 template
: &[InlineAsmTemplatePiece
],
68 operands
: &[GlobalAsmOperandRef
],
69 options
: InlineAsmOptions
,