fn memfill<'a, 'tcx>(b: &Builder<'a, 'tcx>, llptr: ValueRef, ty: Ty<'tcx>, byte: u8) {
    let _icx = push_ctxt("memfill");
    let ccx = b.ccx;

    let llty = type_of::type_of(ccx, ty);
    let ptr_width = &ccx.sess().target.target.target_pointer_width[..];
    let intrinsic_key = format!("llvm.memset.p0i8.i{}", ptr_width);

    let llintrinsicfn = ccx.get_intrinsic(&intrinsic_key);
    let llptr = b.pointercast(llptr, Type::i8(ccx).ptr_to());
    let llzeroval = C_u8(ccx, byte);
    let size = machine::llsize_of(ccx, llty);
    let align = C_i32(ccx, type_of::align_of(ccx, ty) as i32);
    let volatile = C_bool(ccx, false);
    b.call(llintrinsicfn, &[llptr, llzeroval, size, align, volatile], None);
}
// Always use this function instead of storing a constant byte to the memory
// in question. e.g. if you store a zero constant, LLVM will drown in vreg
// allocation for large data structures, and the generated code will be
// awful. (A telltale sign of this is large quantities of
// `mov [byte ptr foo],0` in the generated code.)
Always use this function instead of storing a constant byte to the memory
in question.
Always use this function instead of storing a constant byte to the memory in question .
fn memfill<'a, 'tcx>(b: &Builder<'a, 'tcx>, llptr: ValueRef, ty: Ty<'tcx>, byte: u8) {
    let _icx = push_ctxt("memfill");
    let ccx = b.ccx;
    let llty = type_of::type_of(ccx, ty);
    let ptr_width = &ccx.sess().target.target.target_pointer_width[..];
    let intrinsic_key = format!("llvm.memset.p0i8.i{}", ptr_width);
    let llintrinsicfn = ccx.get_intrinsic(&intrinsic_key);
    let llptr = b.pointercast(llptr, Type::i8(ccx).ptr_to());
    let llzeroval = C_u8(ccx, byte);
    let size = machine::llsize_of(ccx, llty);
    let align = C_i32(ccx, type_of::align_of(ccx, ty) as i32);
    let volatile = C_bool(ccx, false);
    b.call(llintrinsicfn, &[llptr, llzeroval, size, align, volatile], None);
}
fn memfill < ' a , ' tcx > ( b : & Builder < ' a , ' tcx > , llptr : ValueRef , ty : Ty < ' tcx > , byte : u8 ) { let _icx = push_ctxt ( " " ) ; let ccx = b . ccx ; let llty = type_of :: type_of ( ccx , ty ) ; let ptr_width = & ccx . sess ( ) . target . target . target_pointer_width [ .. ] ; let intrinsic_key = format ! ( " " ptr_width ) ; let llintrinsicfn = ccx . get_intrinsic ( & intrinsic_key ) ; let llptr = b . pointercast ( llptr , Type :: i8 ( ccx ) . ptr_to ( ) ) ; let llzeroval = C_u8 ( ccx , byte ) ; let size = machine :: llsize_of ( ccx , llty ) ; let align = C_i32 ( ccx , type_of :: align_of ( ccx , ty ) as i32 ) ; let volatile = C_bool ( ccx , false ) ; b . call ( llintrinsicfn , & [ llptr , llzeroval , size , align , volatile ] , None ) ; }
Always use this function instead of storing a constant byte to the memory
in question.
Always use this function instead of storing a constant byte to the memory in question .
b
&Builder<'a, 'tcx>
llptr
ValueRef
ty
Ty<'tcx>
byte
u8
b
&Builder<'a, 'tcx>
llptr
ValueRef
ty
Ty<'tcx>
byte
u8