2018-11-24 16:30:29 +01:00
|
|
|
use super::BackendTypes;
|
2019-02-09 23:31:47 +09:00
|
|
|
use crate::mir::operand::OperandRef;
|
2020-03-29 16:41:09 +02:00
|
|
|
use rustc_middle::ty::{self, Ty};
|
2020-08-15 04:42:13 -07:00
|
|
|
use rustc_span::Span;
|
2019-10-29 16:35:26 +02:00
|
|
|
use rustc_target::abi::call::FnAbi;
|
2018-09-07 15:39:39 -07:00
|
|
|
|
2018-11-24 16:30:29 +01:00
|
|
|
pub trait IntrinsicCallMethods<'tcx>: BackendTypes {
|
2018-09-24 17:35:39 +02:00
|
|
|
/// Remember to add all intrinsics here, in librustc_typeck/check/mod.rs,
|
|
|
|
/// and in libcore/intrinsics.rs; if you need access to any llvm intrinsics,
|
|
|
|
/// add them to librustc_codegen_llvm/context.rs
|
2018-09-11 11:46:03 +02:00
|
|
|
fn codegen_intrinsic_call(
|
2018-10-05 15:08:49 +02:00
|
|
|
&mut self,
|
2019-06-07 19:22:42 +02:00
|
|
|
instance: ty::Instance<'tcx>,
|
2019-10-29 16:35:26 +02:00
|
|
|
fn_abi: &FnAbi<'tcx, Ty<'tcx>>,
|
2018-09-11 11:46:03 +02:00
|
|
|
args: &[OperandRef<'tcx, Self::Value>],
|
|
|
|
llresult: Self::Value,
|
|
|
|
span: Span,
|
|
|
|
);
|
2018-09-07 15:39:39 -07:00
|
|
|
|
2018-11-24 16:01:47 +01:00
|
|
|
fn abort(&mut self);
|
|
|
|
fn assume(&mut self, val: Self::Value);
|
|
|
|
fn expect(&mut self, cond: Self::Value, expected: bool) -> Self::Value;
|
2019-06-06 08:39:20 +08:00
|
|
|
fn sideeffect(&mut self);
|
2019-03-25 14:28:03 -07:00
|
|
|
/// Trait method used to inject `va_start` on the "spoofed" `VaListImpl` in
|
2018-11-30 15:53:44 +00:00
|
|
|
/// Rust defined C-variadic functions.
|
|
|
|
fn va_start(&mut self, val: Self::Value) -> Self::Value;
|
2019-03-25 14:28:03 -07:00
|
|
|
/// Trait method used to inject `va_end` on the "spoofed" `VaListImpl` before
|
2018-11-30 15:53:44 +00:00
|
|
|
/// Rust defined C-variadic functions return.
|
|
|
|
fn va_end(&mut self, val: Self::Value) -> Self::Value;
|
2018-09-07 15:39:39 -07:00
|
|
|
}
|