1 use super::BackendTypes;
2 use crate::mir::operand::OperandRef;
3 use rustc_middle::ty::{self, Ty};
5 use rustc_target::abi::call::FnAbi;
7 pub 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(
13 instance: ty::Instance<'tcx>,
14 fn_abi: &FnAbi<'tcx, Ty<'tcx>>,
15 args: &[OperandRef<'tcx, Self::Value>],
16 llresult: Self::Value,
18 caller_instance: ty::Instance<'tcx>,
22 fn assume(&mut self, val: Self::Value);
23 fn expect(&mut self, cond: Self::Value, expected: bool) -> Self::Value;
24 fn sideeffect(&mut self);
25 /// Trait method used to inject `va_start` on the "spoofed" `VaListImpl` in
26 /// Rust defined C-variadic functions.
27 fn va_start(&mut self, val: Self::Value) -> Self::Value;
28 /// Trait method used to inject `va_end` on the "spoofed" `VaListImpl` before
29 /// Rust defined C-variadic functions return.
30 fn va_end(&mut self, val: Self::Value) -> Self::Value;