Use the method form for CodegenCx everywhere
This commit is contained in:
parent
6c5b990c5f
commit
3e77f2fc4f
16 changed files with 54 additions and 55 deletions
|
@ -157,14 +157,14 @@ pub fn bin_op_to_fcmp_predicate(op: hir::BinOpKind) -> RealPredicate {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn compare_simd_types(
|
||||
bx: &Builder<'a, 'll, 'tcx>,
|
||||
lhs: &'ll Value,
|
||||
rhs: &'ll Value,
|
||||
pub fn compare_simd_types<'a, 'll:'a, 'tcx:'ll, Builder: BuilderMethods<'a, 'll, 'tcx>>(
|
||||
bx: &Builder,
|
||||
lhs: Builder::Value,
|
||||
rhs: Builder::Value,
|
||||
t: Ty<'tcx>,
|
||||
ret_ty: &'ll Type,
|
||||
ret_ty: Builder::Type,
|
||||
op: hir::BinOpKind
|
||||
) -> &'ll Value {
|
||||
) -> Builder::Value {
|
||||
let signed = match t.sty {
|
||||
ty::Float(_) => {
|
||||
let cmp = bin_op_to_fcmp_predicate(op);
|
||||
|
@ -198,7 +198,7 @@ pub fn unsized_info(
|
|||
let (source, target) = cx.tcx.struct_lockstep_tails(source, target);
|
||||
match (&source.sty, &target.sty) {
|
||||
(&ty::Array(_, len), &ty::Slice(_)) => {
|
||||
CodegenCx::c_usize(cx, len.unwrap_usize(cx.tcx))
|
||||
cx.c_usize(len.unwrap_usize(cx.tcx))
|
||||
}
|
||||
(&ty::Dynamic(..), &ty::Dynamic(..)) => {
|
||||
// For now, upcasts are limited to changes in marker
|
||||
|
@ -460,7 +460,7 @@ pub fn memcpy_ty<'a, 'll: 'a, 'tcx: 'll>(
|
|||
return;
|
||||
}
|
||||
|
||||
call_memcpy(bx, dst, dst_align, src, src_align, CodegenCx::c_usize(bx.cx(), size), flags);
|
||||
call_memcpy(bx, dst, dst_align, src, src_align, bx.cx().c_usize(size), flags);
|
||||
}
|
||||
|
||||
pub fn call_memset(
|
||||
|
@ -474,7 +474,7 @@ pub fn call_memset(
|
|||
let ptr_width = &bx.cx().sess().target.target.target_pointer_width;
|
||||
let intrinsic_key = format!("llvm.memset.p0i8.i{}", ptr_width);
|
||||
let llintrinsicfn = bx.cx().get_intrinsic(&intrinsic_key);
|
||||
let volatile = CodegenCx::c_bool(bx.cx(), volatile);
|
||||
let volatile = bx.cx().c_bool(volatile);
|
||||
bx.call(llintrinsicfn, &[ptr, fill_byte, size, align, volatile], None)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue