Inline and remove Builder::entry_block

This commit is contained in:
Mark Simulacrum 2017-01-02 13:51:09 -07:00
parent ba37c91831
commit c3fe2590f5
7 changed files with 7 additions and 11 deletions

View file

@ -610,7 +610,7 @@ pub fn trans_ctor_shim<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>,
let sig = ccx.tcx().erase_late_bound_regions_and_normalize(&ctor_ty.fn_sig());
let fn_ty = FnType::new(ccx, Abi::Rust, &sig, &[]);
let bcx = Builder::entry_block(ccx, llfn);
let bcx = Builder::new_block(ccx, llfn, "entry-block");
if !fn_ty.ret.is_ignore() {
// But if there are no nested returns, we skip the indirection
// and have a single retslot

View file

@ -51,10 +51,6 @@ fn noname() -> *const c_char {
}
impl<'a, 'tcx> Builder<'a, 'tcx> {
pub fn entry_block(ccx: &'a CrateContext<'a, 'tcx>, llfn: ValueRef) -> Self {
Builder::new_block(ccx, llfn, "entry-block")
}
pub fn new_block<'b>(ccx: &'a CrateContext<'a, 'tcx>, llfn: ValueRef, name: &'b str) -> Self {
let builder = Builder::with_ccx(ccx);
let llbb = unsafe {

View file

@ -329,7 +329,7 @@ fn trans_fn_once_adapter_shim<'a, 'tcx>(
attributes::set_frame_pointer_elimination(ccx, lloncefn);
let orig_fn_ty = fn_ty;
let mut bcx = Builder::entry_block(ccx, lloncefn);
let mut bcx = Builder::new_block(ccx, lloncefn, "entry-block");
let callee = Callee {
data: Fn(llreffn),
@ -489,7 +489,7 @@ fn trans_fn_pointer_shim<'a, 'tcx>(
let llfn = declare::define_internal_fn(ccx, &function_name, tuple_fn_ty);
attributes::set_frame_pointer_elimination(ccx, llfn);
//
let bcx = Builder::entry_block(ccx, llfn);
let bcx = Builder::new_block(ccx, llfn, "entry-block");
let mut llargs = get_params(llfn);

View file

@ -173,7 +173,7 @@ pub fn implement_drop_glue<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>, g: DropGlueKi
assert_eq!(g.ty(), get_drop_glue_type(ccx.shared(), g.ty()));
let (llfn, _) = ccx.drop_glues().borrow().get(&g).unwrap().clone();
let mut bcx = Builder::entry_block(ccx, llfn);
let mut bcx = Builder::new_block(ccx, llfn, "entry-block");
ccx.stats().n_glues_created.set(ccx.stats().n_glues_created.get() + 1);
// All glue functions take values passed *by alias*; this is a

View file

@ -883,7 +883,7 @@ fn gen_fn<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>,
sig: ty::Binder(sig)
}));
let llfn = declare::define_internal_fn(ccx, name, rust_fn_ty);
let bcx = Builder::entry_block(ccx, llfn);
let bcx = Builder::new_block(ccx, llfn, "entry-block");
trans(bcx);
llfn
}

View file

@ -76,7 +76,7 @@ pub fn trans_object_shim<'a, 'tcx>(ccx: &'a CrateContext<'a, 'tcx>,
let llfn = declare::define_internal_fn(ccx, &function_name, callee.ty);
attributes::set_frame_pointer_elimination(ccx, llfn);
let bcx = Builder::entry_block(ccx, llfn);
let bcx = Builder::new_block(ccx, llfn, "entry-block");
let mut llargs = get_params(llfn);
let fn_ret = callee.ty.fn_ret();

View file

@ -210,7 +210,7 @@ pub fn trans_mir<'a, 'tcx: 'a>(
debug!("fn_ty: {:?}", fn_ty);
let debug_context =
debuginfo::create_function_debug_context(ccx, instance, sig, abi, llfn, mir);
let bcx = Builder::entry_block(ccx, llfn);
let bcx = Builder::new_block(ccx, llfn, "entry-block");
let cleanup_kinds = analyze::cleanup_kinds(&mir);