Add missing lifetime intrinsics in a few places
This commit is contained in:
parent
6c512dc52b
commit
95337a2978
4 changed files with 9 additions and 3 deletions
|
@ -730,8 +730,9 @@ impl<'blk, 'tcx> CleanupHelperMethods<'blk, 'tcx> for FunctionContext<'blk, 'tcx
|
||||||
let prev_bcx = self.new_block(true, "resume", None);
|
let prev_bcx = self.new_block(true, "resume", None);
|
||||||
let personality = self.personality.get().expect(
|
let personality = self.personality.get().expect(
|
||||||
"create_landing_pad() should have set this");
|
"create_landing_pad() should have set this");
|
||||||
build::Resume(prev_bcx,
|
let lp = build::Load(prev_bcx, personality);
|
||||||
build::Load(prev_bcx, personality));
|
base::call_lifetime_end(prev_bcx, personality);
|
||||||
|
build::Resume(prev_bcx, lp);
|
||||||
prev_llbb = prev_bcx.llbb;
|
prev_llbb = prev_bcx.llbb;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -432,6 +432,7 @@ pub fn trans_native_call<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
|
||||||
// - Truncating foreign type to correct integral type and then
|
// - Truncating foreign type to correct integral type and then
|
||||||
// bitcasting to the struct type yields invalid cast errors.
|
// bitcasting to the struct type yields invalid cast errors.
|
||||||
let llscratch = base::alloca(bcx, llforeign_ret_ty, "__cast");
|
let llscratch = base::alloca(bcx, llforeign_ret_ty, "__cast");
|
||||||
|
base::call_lifetime_start(bcx, llscratch);
|
||||||
Store(bcx, llforeign_retval, llscratch);
|
Store(bcx, llforeign_retval, llscratch);
|
||||||
let llscratch_i8 = BitCast(bcx, llscratch, Type::i8(ccx).ptr_to());
|
let llscratch_i8 = BitCast(bcx, llscratch, Type::i8(ccx).ptr_to());
|
||||||
let llretptr_i8 = BitCast(bcx, llretptr, Type::i8(ccx).ptr_to());
|
let llretptr_i8 = BitCast(bcx, llretptr, Type::i8(ccx).ptr_to());
|
||||||
|
@ -442,6 +443,7 @@ pub fn trans_native_call<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
|
||||||
debug!("llrust_size={}", llrust_size);
|
debug!("llrust_size={}", llrust_size);
|
||||||
base::call_memcpy(bcx, llretptr_i8, llscratch_i8,
|
base::call_memcpy(bcx, llretptr_i8, llscratch_i8,
|
||||||
C_uint(ccx, llrust_size), llalign as u32);
|
C_uint(ccx, llrust_size), llalign as u32);
|
||||||
|
base::call_lifetime_end(bcx, llscratch);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -190,7 +190,9 @@ pub fn drop_ty_immediate<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
|
||||||
let vp = alloca(bcx, type_of(bcx.ccx(), t), "");
|
let vp = alloca(bcx, type_of(bcx.ccx(), t), "");
|
||||||
call_lifetime_start(bcx, vp);
|
call_lifetime_start(bcx, vp);
|
||||||
store_ty(bcx, v, vp, t);
|
store_ty(bcx, v, vp, t);
|
||||||
drop_ty_core(bcx, vp, t, debug_loc, skip_dtor, None)
|
let bcx = drop_ty_core(bcx, vp, t, debug_loc, skip_dtor, None);
|
||||||
|
call_lifetime_end(bcx, vp);
|
||||||
|
bcx
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn get_drop_glue<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>, t: Ty<'tcx>) -> ValueRef {
|
pub fn get_drop_glue<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>, t: Ty<'tcx>) -> ValueRef {
|
||||||
|
|
|
@ -966,6 +966,7 @@ pub fn trans_intrinsic_call<'a, 'blk, 'tcx>(mut bcx: Block<'blk, 'tcx>,
|
||||||
match dest {
|
match dest {
|
||||||
expr::Ignore => {
|
expr::Ignore => {
|
||||||
bcx = glue::drop_ty(bcx, llresult, ret_ty, call_debug_location);
|
bcx = glue::drop_ty(bcx, llresult, ret_ty, call_debug_location);
|
||||||
|
call_lifetime_end(bcx, llresult);
|
||||||
}
|
}
|
||||||
expr::SaveIn(_) => {}
|
expr::SaveIn(_) => {}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue