Inline/Replace finish with build_return_block

This commit is contained in:
Mark Simulacrum 2016-12-17 20:19:34 -07:00
parent b48e74b5b0
commit 515d14f094
4 changed files with 5 additions and 11 deletions

View File

@ -565,12 +565,6 @@ pub fn alloc_ty<'a, 'tcx>(bcx: &BlockAndBuilder<'a, 'tcx>, ty: Ty<'tcx>, name: &
}
impl<'a, 'tcx> FunctionContext<'a, 'tcx> {
/// Ties up the llstaticallocas -> llloadenv -> lltop edges,
/// and builds the return block.
pub fn finish(&'a self, ret_cx: &BlockAndBuilder<'a, 'tcx>) {
self.build_return_block(ret_cx);
}
// Builds the return block for a function.
pub fn build_return_block(&self, ret_cx: &BlockAndBuilder<'a, 'tcx>) {
if self.llretslotptr.is_none() || self.fn_ty.ret.is_indirect() {
@ -711,7 +705,7 @@ pub fn trans_ctor_shim<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>,
adt::trans_set_discr(&bcx, sig.output(), dest, disr);
}
fcx.finish(&bcx);
fcx.build_return_block(&bcx);
}
pub fn llvm_linkage_by_name(name: &str) -> Option<Linkage> {

View File

@ -419,7 +419,7 @@ fn trans_fn_once_adapter_shim<'a, 'tcx>(
bcx.unreachable();
}
self_scope.trans(&bcx);
fcx.finish(&bcx);
fcx.build_return_block(&bcx);
ccx.instances().borrow_mut().insert(method_instance, lloncefn);
@ -540,7 +540,7 @@ fn trans_fn_pointer_shim<'a, 'tcx>(
ty: bare_fn_ty
};
callee.call(&bcx, &llargs[(self_idx + 1)..], fcx.llretslotptr, None);
fcx.finish(&bcx);
fcx.build_return_block(&bcx);
ccx.fn_pointer_shims().borrow_mut().insert(bare_fn_ty_maybe_ref, llfn);

View File

@ -201,7 +201,7 @@ pub fn implement_drop_glue<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>, g: DropGlueKi
// type, so we don't need to explicitly cast the function parameter.
let bcx = make_drop_glue(bcx, get_param(llfn, 0), g);
fcx.finish(&bcx);
fcx.build_return_block(&bcx);
}
fn trans_custom_dtor<'a, 'tcx>(mut bcx: BlockAndBuilder<'a, 'tcx>,

View File

@ -86,7 +86,7 @@ pub fn trans_object_shim<'a, 'tcx>(ccx: &'a CrateContext<'a, 'tcx>,
let llargs = get_params(fcx.llfn);
callee.call(&bcx, &llargs[fcx.fn_ty.ret.is_indirect() as usize..], fcx.llretslotptr, None);
fcx.finish(&bcx);
fcx.build_return_block(&bcx);
llfn
}