rust/src/librustc_codegen_ssa/traits/intrinsic.rs

24 lines
772 B
Rust
Raw Normal View History

use super::BackendTypes;
2018-09-11 11:46:03 +02:00
use mir::operand::OperandRef;
use rustc::ty::Ty;
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
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(
&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
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
}