2018-11-24 16:30:29 +01:00
|
|
|
use super::BackendTypes;
|
2018-09-11 11:46:03 +02:00
|
|
|
use mir::operand::OperandRef;
|
|
|
|
use rustc::ty::Ty;
|
2018-10-03 13:49:57 +02:00
|
|
|
use rustc_target::abi::call::FnType;
|
2018-09-11 11:46:03 +02:00
|
|
|
use syntax_pos::Span;
|
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,
|
2018-09-11 11:46:03 +02:00
|
|
|
callee_ty: Ty<'tcx>,
|
|
|
|
fn_ty: &FnType<'tcx, Ty<'tcx>>,
|
|
|
|
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;
|
2018-09-07 15:39:39 -07:00
|
|
|
}
|