]>
Commit | Line | Data |
---|---|---|
a1dfa0c6 XL |
1 | // Copyright 2018 The Rust Project Developers. See the COPYRIGHT |
2 | // file at the top-level directory of this distribution and at | |
3 | // http://rust-lang.org/COPYRIGHT. | |
4 | // | |
5 | // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or | |
6 | // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license | |
7 | // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your | |
8 | // option. This file may not be copied, modified, or distributed | |
9 | // except according to those terms. | |
10 | ||
11 | use super::BackendTypes; | |
12 | use mir::operand::OperandRef; | |
13 | use rustc::ty::Ty; | |
14 | use rustc_target::abi::call::FnType; | |
15 | use syntax_pos::Span; | |
16 | ||
17 | pub trait IntrinsicCallMethods<'tcx>: BackendTypes { | |
18 | /// Remember to add all intrinsics here, in librustc_typeck/check/mod.rs, | |
19 | /// and in libcore/intrinsics.rs; if you need access to any llvm intrinsics, | |
20 | /// add them to librustc_codegen_llvm/context.rs | |
21 | fn codegen_intrinsic_call( | |
22 | &mut self, | |
23 | callee_ty: Ty<'tcx>, | |
24 | fn_ty: &FnType<'tcx, Ty<'tcx>>, | |
25 | args: &[OperandRef<'tcx, Self::Value>], | |
26 | llresult: Self::Value, | |
27 | span: Span, | |
28 | ); | |
29 | ||
30 | fn abort(&mut self); | |
31 | fn assume(&mut self, val: Self::Value); | |
32 | fn expect(&mut self, cond: Self::Value, expected: bool) -> Self::Value; | |
33 | } |