]> git.proxmox.com Git - rustc.git/blame - src/librustc_codegen_ssa/traits/intrinsic.rs
New upstream version 1.47.0+dfsg1
[rustc.git] / src / librustc_codegen_ssa / traits / intrinsic.rs
CommitLineData
a1dfa0c6 1use super::BackendTypes;
9fa01778 2use crate::mir::operand::OperandRef;
ba9703b0 3use rustc_middle::ty::{self, Ty};
dfeec247 4use rustc_span::Span;
60c5eb7d 5use rustc_target::abi::call::FnAbi;
a1dfa0c6
XL
6
7pub trait IntrinsicCallMethods<'tcx>: BackendTypes {
8 /// Remember to add all intrinsics here, in librustc_typeck/check/mod.rs,
9 /// and in libcore/intrinsics.rs; if you need access to any llvm intrinsics,
10 /// add them to librustc_codegen_llvm/context.rs
11 fn codegen_intrinsic_call(
12 &mut self,
e1599b0c 13 instance: ty::Instance<'tcx>,
60c5eb7d 14 fn_abi: &FnAbi<'tcx, Ty<'tcx>>,
a1dfa0c6
XL
15 args: &[OperandRef<'tcx, Self::Value>],
16 llresult: Self::Value,
17 span: Span,
18 );
19
20 fn abort(&mut self);
21 fn assume(&mut self, val: Self::Value);
22 fn expect(&mut self, cond: Self::Value, expected: bool) -> Self::Value;
e74abb32 23 fn sideeffect(&mut self);
dc9dc135 24 /// Trait method used to inject `va_start` on the "spoofed" `VaListImpl` in
532ac7d7
XL
25 /// Rust defined C-variadic functions.
26 fn va_start(&mut self, val: Self::Value) -> Self::Value;
dc9dc135 27 /// Trait method used to inject `va_end` on the "spoofed" `VaListImpl` before
532ac7d7
XL
28 /// Rust defined C-variadic functions return.
29 fn va_end(&mut self, val: Self::Value) -> Self::Value;
a1dfa0c6 30}