Skip to content

Commit

Permalink
Inline and remove Builder::entry_block
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark-Simulacrum committed Jan 4, 2017
1 parent ba37c91 commit c3fe259
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/librustc_trans/base.rs
Expand Up @@ -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
Expand Down
4 changes: 0 additions & 4 deletions src/librustc_trans/builder.rs
Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions src/librustc_trans/callee.rs
Expand Up @@ -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),
Expand Down Expand Up @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion src/librustc_trans/glue.rs
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_trans/intrinsic.rs
Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_trans/meth.rs
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_trans/mir/mod.rs
Expand Up @@ -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);

Expand Down

0 comments on commit c3fe259

Please sign in to comment.