• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 use super::abi::AbiBuilderMethods;
2 use super::asm::AsmBuilderMethods;
3 use super::coverageinfo::CoverageInfoBuilderMethods;
4 use super::debuginfo::DebugInfoBuilderMethods;
5 use super::intrinsic::IntrinsicCallMethods;
6 use super::misc::MiscMethods;
7 use super::type_::{ArgAbiMethods, BaseTypeMethods};
8 use super::{HasCodegen, StaticBuilderMethods};
9 
10 use crate::common::{
11     AtomicOrdering, AtomicRmwBinOp, IntPredicate, RealPredicate, SynchronizationScope, TypeKind,
12 };
13 use crate::mir::operand::OperandRef;
14 use crate::mir::place::PlaceRef;
15 use crate::MemFlags;
16 
17 use rustc_middle::middle::codegen_fn_attrs::CodegenFnAttrs;
18 use rustc_middle::ty::layout::{HasParamEnv, TyAndLayout};
19 use rustc_middle::ty::Ty;
20 use rustc_span::Span;
21 use rustc_target::abi::call::FnAbi;
22 use rustc_target::abi::{Abi, Align, Scalar, Size, WrappingRange};
23 use rustc_target::spec::HasTargetSpec;
24 
25 #[derive(Copy, Clone)]
26 pub enum OverflowOp {
27     Add,
28     Sub,
29     Mul,
30 }
31 
32 pub trait BuilderMethods<'a, 'tcx>:
33     HasCodegen<'tcx>
34     + CoverageInfoBuilderMethods<'tcx>
35     + DebugInfoBuilderMethods
36     + ArgAbiMethods<'tcx>
37     + AbiBuilderMethods<'tcx>
38     + IntrinsicCallMethods<'tcx>
39     + AsmBuilderMethods<'tcx>
40     + StaticBuilderMethods
41     + HasParamEnv<'tcx>
42     + HasTargetSpec
43 {
build(cx: &'a Self::CodegenCx, llbb: Self::BasicBlock) -> Self44     fn build(cx: &'a Self::CodegenCx, llbb: Self::BasicBlock) -> Self;
45 
cx(&self) -> &Self::CodegenCx46     fn cx(&self) -> &Self::CodegenCx;
llbb(&self) -> Self::BasicBlock47     fn llbb(&self) -> Self::BasicBlock;
48 
set_span(&mut self, span: Span)49     fn set_span(&mut self, span: Span);
50 
51     // FIXME(eddyb) replace uses of this with `append_sibling_block`.
append_block(cx: &'a Self::CodegenCx, llfn: Self::Function, name: &str) -> Self::BasicBlock52     fn append_block(cx: &'a Self::CodegenCx, llfn: Self::Function, name: &str) -> Self::BasicBlock;
53 
append_sibling_block(&mut self, name: &str) -> Self::BasicBlock54     fn append_sibling_block(&mut self, name: &str) -> Self::BasicBlock;
55 
switch_to_block(&mut self, llbb: Self::BasicBlock)56     fn switch_to_block(&mut self, llbb: Self::BasicBlock);
57 
ret_void(&mut self)58     fn ret_void(&mut self);
ret(&mut self, v: Self::Value)59     fn ret(&mut self, v: Self::Value);
br(&mut self, dest: Self::BasicBlock)60     fn br(&mut self, dest: Self::BasicBlock);
cond_br( &mut self, cond: Self::Value, then_llbb: Self::BasicBlock, else_llbb: Self::BasicBlock, )61     fn cond_br(
62         &mut self,
63         cond: Self::Value,
64         then_llbb: Self::BasicBlock,
65         else_llbb: Self::BasicBlock,
66     );
switch( &mut self, v: Self::Value, else_llbb: Self::BasicBlock, cases: impl ExactSizeIterator<Item = (u128, Self::BasicBlock)>, )67     fn switch(
68         &mut self,
69         v: Self::Value,
70         else_llbb: Self::BasicBlock,
71         cases: impl ExactSizeIterator<Item = (u128, Self::BasicBlock)>,
72     );
invoke( &mut self, llty: Self::Type, fn_attrs: Option<&CodegenFnAttrs>, fn_abi: Option<&FnAbi<'tcx, Ty<'tcx>>>, llfn: Self::Value, args: &[Self::Value], then: Self::BasicBlock, catch: Self::BasicBlock, funclet: Option<&Self::Funclet>, ) -> Self::Value73     fn invoke(
74         &mut self,
75         llty: Self::Type,
76         fn_attrs: Option<&CodegenFnAttrs>,
77         fn_abi: Option<&FnAbi<'tcx, Ty<'tcx>>>,
78         llfn: Self::Value,
79         args: &[Self::Value],
80         then: Self::BasicBlock,
81         catch: Self::BasicBlock,
82         funclet: Option<&Self::Funclet>,
83     ) -> Self::Value;
unreachable(&mut self)84     fn unreachable(&mut self);
85 
add(&mut self, lhs: Self::Value, rhs: Self::Value) -> Self::Value86     fn add(&mut self, lhs: Self::Value, rhs: Self::Value) -> Self::Value;
fadd(&mut self, lhs: Self::Value, rhs: Self::Value) -> Self::Value87     fn fadd(&mut self, lhs: Self::Value, rhs: Self::Value) -> Self::Value;
fadd_fast(&mut self, lhs: Self::Value, rhs: Self::Value) -> Self::Value88     fn fadd_fast(&mut self, lhs: Self::Value, rhs: Self::Value) -> Self::Value;
sub(&mut self, lhs: Self::Value, rhs: Self::Value) -> Self::Value89     fn sub(&mut self, lhs: Self::Value, rhs: Self::Value) -> Self::Value;
fsub(&mut self, lhs: Self::Value, rhs: Self::Value) -> Self::Value90     fn fsub(&mut self, lhs: Self::Value, rhs: Self::Value) -> Self::Value;
fsub_fast(&mut self, lhs: Self::Value, rhs: Self::Value) -> Self::Value91     fn fsub_fast(&mut self, lhs: Self::Value, rhs: Self::Value) -> Self::Value;
mul(&mut self, lhs: Self::Value, rhs: Self::Value) -> Self::Value92     fn mul(&mut self, lhs: Self::Value, rhs: Self::Value) -> Self::Value;
fmul(&mut self, lhs: Self::Value, rhs: Self::Value) -> Self::Value93     fn fmul(&mut self, lhs: Self::Value, rhs: Self::Value) -> Self::Value;
fmul_fast(&mut self, lhs: Self::Value, rhs: Self::Value) -> Self::Value94     fn fmul_fast(&mut self, lhs: Self::Value, rhs: Self::Value) -> Self::Value;
udiv(&mut self, lhs: Self::Value, rhs: Self::Value) -> Self::Value95     fn udiv(&mut self, lhs: Self::Value, rhs: Self::Value) -> Self::Value;
exactudiv(&mut self, lhs: Self::Value, rhs: Self::Value) -> Self::Value96     fn exactudiv(&mut self, lhs: Self::Value, rhs: Self::Value) -> Self::Value;
sdiv(&mut self, lhs: Self::Value, rhs: Self::Value) -> Self::Value97     fn sdiv(&mut self, lhs: Self::Value, rhs: Self::Value) -> Self::Value;
exactsdiv(&mut self, lhs: Self::Value, rhs: Self::Value) -> Self::Value98     fn exactsdiv(&mut self, lhs: Self::Value, rhs: Self::Value) -> Self::Value;
fdiv(&mut self, lhs: Self::Value, rhs: Self::Value) -> Self::Value99     fn fdiv(&mut self, lhs: Self::Value, rhs: Self::Value) -> Self::Value;
fdiv_fast(&mut self, lhs: Self::Value, rhs: Self::Value) -> Self::Value100     fn fdiv_fast(&mut self, lhs: Self::Value, rhs: Self::Value) -> Self::Value;
urem(&mut self, lhs: Self::Value, rhs: Self::Value) -> Self::Value101     fn urem(&mut self, lhs: Self::Value, rhs: Self::Value) -> Self::Value;
srem(&mut self, lhs: Self::Value, rhs: Self::Value) -> Self::Value102     fn srem(&mut self, lhs: Self::Value, rhs: Self::Value) -> Self::Value;
frem(&mut self, lhs: Self::Value, rhs: Self::Value) -> Self::Value103     fn frem(&mut self, lhs: Self::Value, rhs: Self::Value) -> Self::Value;
frem_fast(&mut self, lhs: Self::Value, rhs: Self::Value) -> Self::Value104     fn frem_fast(&mut self, lhs: Self::Value, rhs: Self::Value) -> Self::Value;
shl(&mut self, lhs: Self::Value, rhs: Self::Value) -> Self::Value105     fn shl(&mut self, lhs: Self::Value, rhs: Self::Value) -> Self::Value;
lshr(&mut self, lhs: Self::Value, rhs: Self::Value) -> Self::Value106     fn lshr(&mut self, lhs: Self::Value, rhs: Self::Value) -> Self::Value;
ashr(&mut self, lhs: Self::Value, rhs: Self::Value) -> Self::Value107     fn ashr(&mut self, lhs: Self::Value, rhs: Self::Value) -> Self::Value;
unchecked_sadd(&mut self, lhs: Self::Value, rhs: Self::Value) -> Self::Value108     fn unchecked_sadd(&mut self, lhs: Self::Value, rhs: Self::Value) -> Self::Value;
unchecked_uadd(&mut self, lhs: Self::Value, rhs: Self::Value) -> Self::Value109     fn unchecked_uadd(&mut self, lhs: Self::Value, rhs: Self::Value) -> Self::Value;
unchecked_ssub(&mut self, lhs: Self::Value, rhs: Self::Value) -> Self::Value110     fn unchecked_ssub(&mut self, lhs: Self::Value, rhs: Self::Value) -> Self::Value;
unchecked_usub(&mut self, lhs: Self::Value, rhs: Self::Value) -> Self::Value111     fn unchecked_usub(&mut self, lhs: Self::Value, rhs: Self::Value) -> Self::Value;
unchecked_smul(&mut self, lhs: Self::Value, rhs: Self::Value) -> Self::Value112     fn unchecked_smul(&mut self, lhs: Self::Value, rhs: Self::Value) -> Self::Value;
unchecked_umul(&mut self, lhs: Self::Value, rhs: Self::Value) -> Self::Value113     fn unchecked_umul(&mut self, lhs: Self::Value, rhs: Self::Value) -> Self::Value;
and(&mut self, lhs: Self::Value, rhs: Self::Value) -> Self::Value114     fn and(&mut self, lhs: Self::Value, rhs: Self::Value) -> Self::Value;
or(&mut self, lhs: Self::Value, rhs: Self::Value) -> Self::Value115     fn or(&mut self, lhs: Self::Value, rhs: Self::Value) -> Self::Value;
xor(&mut self, lhs: Self::Value, rhs: Self::Value) -> Self::Value116     fn xor(&mut self, lhs: Self::Value, rhs: Self::Value) -> Self::Value;
neg(&mut self, v: Self::Value) -> Self::Value117     fn neg(&mut self, v: Self::Value) -> Self::Value;
fneg(&mut self, v: Self::Value) -> Self::Value118     fn fneg(&mut self, v: Self::Value) -> Self::Value;
not(&mut self, v: Self::Value) -> Self::Value119     fn not(&mut self, v: Self::Value) -> Self::Value;
120 
checked_binop( &mut self, oop: OverflowOp, ty: Ty<'_>, lhs: Self::Value, rhs: Self::Value, ) -> (Self::Value, Self::Value)121     fn checked_binop(
122         &mut self,
123         oop: OverflowOp,
124         ty: Ty<'_>,
125         lhs: Self::Value,
126         rhs: Self::Value,
127     ) -> (Self::Value, Self::Value);
128 
from_immediate(&mut self, val: Self::Value) -> Self::Value129     fn from_immediate(&mut self, val: Self::Value) -> Self::Value;
to_immediate(&mut self, val: Self::Value, layout: TyAndLayout<'_>) -> Self::Value130     fn to_immediate(&mut self, val: Self::Value, layout: TyAndLayout<'_>) -> Self::Value {
131         if let Abi::Scalar(scalar) = layout.abi {
132             self.to_immediate_scalar(val, scalar)
133         } else {
134             val
135         }
136     }
to_immediate_scalar(&mut self, val: Self::Value, scalar: Scalar) -> Self::Value137     fn to_immediate_scalar(&mut self, val: Self::Value, scalar: Scalar) -> Self::Value;
138 
alloca(&mut self, ty: Self::Type, align: Align) -> Self::Value139     fn alloca(&mut self, ty: Self::Type, align: Align) -> Self::Value;
byte_array_alloca(&mut self, len: Self::Value, align: Align) -> Self::Value140     fn byte_array_alloca(&mut self, len: Self::Value, align: Align) -> Self::Value;
141 
load(&mut self, ty: Self::Type, ptr: Self::Value, align: Align) -> Self::Value142     fn load(&mut self, ty: Self::Type, ptr: Self::Value, align: Align) -> Self::Value;
volatile_load(&mut self, ty: Self::Type, ptr: Self::Value) -> Self::Value143     fn volatile_load(&mut self, ty: Self::Type, ptr: Self::Value) -> Self::Value;
atomic_load( &mut self, ty: Self::Type, ptr: Self::Value, order: AtomicOrdering, size: Size, ) -> Self::Value144     fn atomic_load(
145         &mut self,
146         ty: Self::Type,
147         ptr: Self::Value,
148         order: AtomicOrdering,
149         size: Size,
150     ) -> Self::Value;
load_operand(&mut self, place: PlaceRef<'tcx, Self::Value>) -> OperandRef<'tcx, Self::Value>151     fn load_operand(&mut self, place: PlaceRef<'tcx, Self::Value>)
152     -> OperandRef<'tcx, Self::Value>;
153 
154     /// Called for Rvalue::Repeat when the elem is neither a ZST nor optimizable using memset.
write_operand_repeatedly( &mut self, elem: OperandRef<'tcx, Self::Value>, count: u64, dest: PlaceRef<'tcx, Self::Value>, )155     fn write_operand_repeatedly(
156         &mut self,
157         elem: OperandRef<'tcx, Self::Value>,
158         count: u64,
159         dest: PlaceRef<'tcx, Self::Value>,
160     );
161 
range_metadata(&mut self, load: Self::Value, range: WrappingRange)162     fn range_metadata(&mut self, load: Self::Value, range: WrappingRange);
nonnull_metadata(&mut self, load: Self::Value)163     fn nonnull_metadata(&mut self, load: Self::Value);
164 
store(&mut self, val: Self::Value, ptr: Self::Value, align: Align) -> Self::Value165     fn store(&mut self, val: Self::Value, ptr: Self::Value, align: Align) -> Self::Value;
store_with_flags( &mut self, val: Self::Value, ptr: Self::Value, align: Align, flags: MemFlags, ) -> Self::Value166     fn store_with_flags(
167         &mut self,
168         val: Self::Value,
169         ptr: Self::Value,
170         align: Align,
171         flags: MemFlags,
172     ) -> Self::Value;
atomic_store( &mut self, val: Self::Value, ptr: Self::Value, order: AtomicOrdering, size: Size, )173     fn atomic_store(
174         &mut self,
175         val: Self::Value,
176         ptr: Self::Value,
177         order: AtomicOrdering,
178         size: Size,
179     );
180 
gep(&mut self, ty: Self::Type, ptr: Self::Value, indices: &[Self::Value]) -> Self::Value181     fn gep(&mut self, ty: Self::Type, ptr: Self::Value, indices: &[Self::Value]) -> Self::Value;
inbounds_gep( &mut self, ty: Self::Type, ptr: Self::Value, indices: &[Self::Value], ) -> Self::Value182     fn inbounds_gep(
183         &mut self,
184         ty: Self::Type,
185         ptr: Self::Value,
186         indices: &[Self::Value],
187     ) -> Self::Value;
struct_gep(&mut self, ty: Self::Type, ptr: Self::Value, idx: u64) -> Self::Value188     fn struct_gep(&mut self, ty: Self::Type, ptr: Self::Value, idx: u64) -> Self::Value;
189 
trunc(&mut self, val: Self::Value, dest_ty: Self::Type) -> Self::Value190     fn trunc(&mut self, val: Self::Value, dest_ty: Self::Type) -> Self::Value;
sext(&mut self, val: Self::Value, dest_ty: Self::Type) -> Self::Value191     fn sext(&mut self, val: Self::Value, dest_ty: Self::Type) -> Self::Value;
fptoui_sat(&mut self, val: Self::Value, dest_ty: Self::Type) -> Self::Value192     fn fptoui_sat(&mut self, val: Self::Value, dest_ty: Self::Type) -> Self::Value;
fptosi_sat(&mut self, val: Self::Value, dest_ty: Self::Type) -> Self::Value193     fn fptosi_sat(&mut self, val: Self::Value, dest_ty: Self::Type) -> Self::Value;
fptoui(&mut self, val: Self::Value, dest_ty: Self::Type) -> Self::Value194     fn fptoui(&mut self, val: Self::Value, dest_ty: Self::Type) -> Self::Value;
fptosi(&mut self, val: Self::Value, dest_ty: Self::Type) -> Self::Value195     fn fptosi(&mut self, val: Self::Value, dest_ty: Self::Type) -> Self::Value;
uitofp(&mut self, val: Self::Value, dest_ty: Self::Type) -> Self::Value196     fn uitofp(&mut self, val: Self::Value, dest_ty: Self::Type) -> Self::Value;
sitofp(&mut self, val: Self::Value, dest_ty: Self::Type) -> Self::Value197     fn sitofp(&mut self, val: Self::Value, dest_ty: Self::Type) -> Self::Value;
fptrunc(&mut self, val: Self::Value, dest_ty: Self::Type) -> Self::Value198     fn fptrunc(&mut self, val: Self::Value, dest_ty: Self::Type) -> Self::Value;
fpext(&mut self, val: Self::Value, dest_ty: Self::Type) -> Self::Value199     fn fpext(&mut self, val: Self::Value, dest_ty: Self::Type) -> Self::Value;
ptrtoint(&mut self, val: Self::Value, dest_ty: Self::Type) -> Self::Value200     fn ptrtoint(&mut self, val: Self::Value, dest_ty: Self::Type) -> Self::Value;
inttoptr(&mut self, val: Self::Value, dest_ty: Self::Type) -> Self::Value201     fn inttoptr(&mut self, val: Self::Value, dest_ty: Self::Type) -> Self::Value;
bitcast(&mut self, val: Self::Value, dest_ty: Self::Type) -> Self::Value202     fn bitcast(&mut self, val: Self::Value, dest_ty: Self::Type) -> Self::Value;
intcast(&mut self, val: Self::Value, dest_ty: Self::Type, is_signed: bool) -> Self::Value203     fn intcast(&mut self, val: Self::Value, dest_ty: Self::Type, is_signed: bool) -> Self::Value;
pointercast(&mut self, val: Self::Value, dest_ty: Self::Type) -> Self::Value204     fn pointercast(&mut self, val: Self::Value, dest_ty: Self::Type) -> Self::Value;
205 
cast_float_to_int( &mut self, signed: bool, x: Self::Value, dest_ty: Self::Type, ) -> Self::Value206     fn cast_float_to_int(
207         &mut self,
208         signed: bool,
209         x: Self::Value,
210         dest_ty: Self::Type,
211     ) -> Self::Value {
212         let in_ty = self.cx().val_ty(x);
213         let (float_ty, int_ty) = if self.cx().type_kind(dest_ty) == TypeKind::Vector
214             && self.cx().type_kind(in_ty) == TypeKind::Vector
215         {
216             (self.cx().element_type(in_ty), self.cx().element_type(dest_ty))
217         } else {
218             (in_ty, dest_ty)
219         };
220         assert!(matches!(self.cx().type_kind(float_ty), TypeKind::Float | TypeKind::Double));
221         assert_eq!(self.cx().type_kind(int_ty), TypeKind::Integer);
222 
223         if let Some(false) = self.cx().sess().opts.unstable_opts.saturating_float_casts {
224             return if signed { self.fptosi(x, dest_ty) } else { self.fptoui(x, dest_ty) };
225         }
226 
227         if signed { self.fptosi_sat(x, dest_ty) } else { self.fptoui_sat(x, dest_ty) }
228     }
229 
icmp(&mut self, op: IntPredicate, lhs: Self::Value, rhs: Self::Value) -> Self::Value230     fn icmp(&mut self, op: IntPredicate, lhs: Self::Value, rhs: Self::Value) -> Self::Value;
fcmp(&mut self, op: RealPredicate, lhs: Self::Value, rhs: Self::Value) -> Self::Value231     fn fcmp(&mut self, op: RealPredicate, lhs: Self::Value, rhs: Self::Value) -> Self::Value;
232 
memcpy( &mut self, dst: Self::Value, dst_align: Align, src: Self::Value, src_align: Align, size: Self::Value, flags: MemFlags, )233     fn memcpy(
234         &mut self,
235         dst: Self::Value,
236         dst_align: Align,
237         src: Self::Value,
238         src_align: Align,
239         size: Self::Value,
240         flags: MemFlags,
241     );
memmove( &mut self, dst: Self::Value, dst_align: Align, src: Self::Value, src_align: Align, size: Self::Value, flags: MemFlags, )242     fn memmove(
243         &mut self,
244         dst: Self::Value,
245         dst_align: Align,
246         src: Self::Value,
247         src_align: Align,
248         size: Self::Value,
249         flags: MemFlags,
250     );
memset( &mut self, ptr: Self::Value, fill_byte: Self::Value, size: Self::Value, align: Align, flags: MemFlags, )251     fn memset(
252         &mut self,
253         ptr: Self::Value,
254         fill_byte: Self::Value,
255         size: Self::Value,
256         align: Align,
257         flags: MemFlags,
258     );
259 
select( &mut self, cond: Self::Value, then_val: Self::Value, else_val: Self::Value, ) -> Self::Value260     fn select(
261         &mut self,
262         cond: Self::Value,
263         then_val: Self::Value,
264         else_val: Self::Value,
265     ) -> Self::Value;
266 
va_arg(&mut self, list: Self::Value, ty: Self::Type) -> Self::Value267     fn va_arg(&mut self, list: Self::Value, ty: Self::Type) -> Self::Value;
extract_element(&mut self, vec: Self::Value, idx: Self::Value) -> Self::Value268     fn extract_element(&mut self, vec: Self::Value, idx: Self::Value) -> Self::Value;
vector_splat(&mut self, num_elts: usize, elt: Self::Value) -> Self::Value269     fn vector_splat(&mut self, num_elts: usize, elt: Self::Value) -> Self::Value;
extract_value(&mut self, agg_val: Self::Value, idx: u64) -> Self::Value270     fn extract_value(&mut self, agg_val: Self::Value, idx: u64) -> Self::Value;
insert_value(&mut self, agg_val: Self::Value, elt: Self::Value, idx: u64) -> Self::Value271     fn insert_value(&mut self, agg_val: Self::Value, elt: Self::Value, idx: u64) -> Self::Value;
272 
set_personality_fn(&mut self, personality: Self::Value)273     fn set_personality_fn(&mut self, personality: Self::Value);
274 
275     // These are used by everyone except msvc
cleanup_landing_pad(&mut self, pers_fn: Self::Value) -> (Self::Value, Self::Value)276     fn cleanup_landing_pad(&mut self, pers_fn: Self::Value) -> (Self::Value, Self::Value);
filter_landing_pad(&mut self, pers_fn: Self::Value) -> (Self::Value, Self::Value)277     fn filter_landing_pad(&mut self, pers_fn: Self::Value) -> (Self::Value, Self::Value);
resume(&mut self, exn0: Self::Value, exn1: Self::Value)278     fn resume(&mut self, exn0: Self::Value, exn1: Self::Value);
279 
280     // These are used only by msvc
cleanup_pad(&mut self, parent: Option<Self::Value>, args: &[Self::Value]) -> Self::Funclet281     fn cleanup_pad(&mut self, parent: Option<Self::Value>, args: &[Self::Value]) -> Self::Funclet;
cleanup_ret(&mut self, funclet: &Self::Funclet, unwind: Option<Self::BasicBlock>)282     fn cleanup_ret(&mut self, funclet: &Self::Funclet, unwind: Option<Self::BasicBlock>);
catch_pad(&mut self, parent: Self::Value, args: &[Self::Value]) -> Self::Funclet283     fn catch_pad(&mut self, parent: Self::Value, args: &[Self::Value]) -> Self::Funclet;
catch_switch( &mut self, parent: Option<Self::Value>, unwind: Option<Self::BasicBlock>, handlers: &[Self::BasicBlock], ) -> Self::Value284     fn catch_switch(
285         &mut self,
286         parent: Option<Self::Value>,
287         unwind: Option<Self::BasicBlock>,
288         handlers: &[Self::BasicBlock],
289     ) -> Self::Value;
290 
atomic_cmpxchg( &mut self, dst: Self::Value, cmp: Self::Value, src: Self::Value, order: AtomicOrdering, failure_order: AtomicOrdering, weak: bool, ) -> Self::Value291     fn atomic_cmpxchg(
292         &mut self,
293         dst: Self::Value,
294         cmp: Self::Value,
295         src: Self::Value,
296         order: AtomicOrdering,
297         failure_order: AtomicOrdering,
298         weak: bool,
299     ) -> Self::Value;
atomic_rmw( &mut self, op: AtomicRmwBinOp, dst: Self::Value, src: Self::Value, order: AtomicOrdering, ) -> Self::Value300     fn atomic_rmw(
301         &mut self,
302         op: AtomicRmwBinOp,
303         dst: Self::Value,
304         src: Self::Value,
305         order: AtomicOrdering,
306     ) -> Self::Value;
atomic_fence(&mut self, order: AtomicOrdering, scope: SynchronizationScope)307     fn atomic_fence(&mut self, order: AtomicOrdering, scope: SynchronizationScope);
set_invariant_load(&mut self, load: Self::Value)308     fn set_invariant_load(&mut self, load: Self::Value);
309 
310     /// Called for `StorageLive`
lifetime_start(&mut self, ptr: Self::Value, size: Size)311     fn lifetime_start(&mut self, ptr: Self::Value, size: Size);
312 
313     /// Called for `StorageDead`
lifetime_end(&mut self, ptr: Self::Value, size: Size)314     fn lifetime_end(&mut self, ptr: Self::Value, size: Size);
315 
instrprof_increment( &mut self, fn_name: Self::Value, hash: Self::Value, num_counters: Self::Value, index: Self::Value, )316     fn instrprof_increment(
317         &mut self,
318         fn_name: Self::Value,
319         hash: Self::Value,
320         num_counters: Self::Value,
321         index: Self::Value,
322     );
323 
call( &mut self, llty: Self::Type, fn_attrs: Option<&CodegenFnAttrs>, fn_abi: Option<&FnAbi<'tcx, Ty<'tcx>>>, llfn: Self::Value, args: &[Self::Value], funclet: Option<&Self::Funclet>, ) -> Self::Value324     fn call(
325         &mut self,
326         llty: Self::Type,
327         fn_attrs: Option<&CodegenFnAttrs>,
328         fn_abi: Option<&FnAbi<'tcx, Ty<'tcx>>>,
329         llfn: Self::Value,
330         args: &[Self::Value],
331         funclet: Option<&Self::Funclet>,
332     ) -> Self::Value;
zext(&mut self, val: Self::Value, dest_ty: Self::Type) -> Self::Value333     fn zext(&mut self, val: Self::Value, dest_ty: Self::Type) -> Self::Value;
334 
do_not_inline(&mut self, llret: Self::Value)335     fn do_not_inline(&mut self, llret: Self::Value);
336 }
337