1 use super::BackendTypes; 2 use crate::mir::operand::OperandRef; 3 use rustc_middle::ty::{self, Ty}; 4 use rustc_span::Span; 5 use rustc_target::abi::call::FnAbi; 6 7 pub trait IntrinsicCallMethods<'tcx>: BackendTypes { 8 /// Remember to add all intrinsics here, in `compiler/rustc_hir_analysis/src/check/mod.rs`, 9 /// and in `library/core/src/intrinsics.rs`; if you need access to any LLVM intrinsics, 10 /// add them to `compiler/rustc_codegen_llvm/src/context.rs`. codegen_intrinsic_call( &mut self, instance: ty::Instance<'tcx>, fn_abi: &FnAbi<'tcx, Ty<'tcx>>, args: &[OperandRef<'tcx, Self::Value>], llresult: Self::Value, span: Span, )11 fn codegen_intrinsic_call( 12 &mut self, 13 instance: ty::Instance<'tcx>, 14 fn_abi: &FnAbi<'tcx, Ty<'tcx>>, 15 args: &[OperandRef<'tcx, Self::Value>], 16 llresult: Self::Value, 17 span: Span, 18 ); 19 abort(&mut self)20 fn abort(&mut self); assume(&mut self, val: Self::Value)21 fn assume(&mut self, val: Self::Value); expect(&mut self, cond: Self::Value, expected: bool) -> Self::Value22 fn expect(&mut self, cond: Self::Value, expected: bool) -> Self::Value; 23 /// Trait method used to test whether a given pointer is associated with a type identifier. type_test(&mut self, pointer: Self::Value, typeid: Self::Value) -> Self::Value24 fn type_test(&mut self, pointer: Self::Value, typeid: Self::Value) -> Self::Value; 25 /// Trait method used to load a function while testing if it is associated with a type 26 /// identifier. type_checked_load( &mut self, llvtable: Self::Value, vtable_byte_offset: u64, typeid: Self::Value, ) -> Self::Value27 fn type_checked_load( 28 &mut self, 29 llvtable: Self::Value, 30 vtable_byte_offset: u64, 31 typeid: Self::Value, 32 ) -> Self::Value; 33 /// Trait method used to inject `va_start` on the "spoofed" `VaListImpl` in 34 /// Rust defined C-variadic functions. va_start(&mut self, val: Self::Value) -> Self::Value35 fn va_start(&mut self, val: Self::Value) -> Self::Value; 36 /// Trait method used to inject `va_end` on the "spoofed" `VaListImpl` before 37 /// Rust defined C-variadic functions return. va_end(&mut self, val: Self::Value) -> Self::Value38 fn va_end(&mut self, val: Self::Value) -> Self::Value; 39 } 40