Skip to content

Commit c3fe259

Browse files
Inline and remove Builder::entry_block
1 parent ba37c91 commit c3fe259

File tree

7 files changed

+7
-11
lines changed

7 files changed

+7
-11
lines changed

src/librustc_trans/base.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -610,7 +610,7 @@ pub fn trans_ctor_shim<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>,
610610
let sig = ccx.tcx().erase_late_bound_regions_and_normalize(&ctor_ty.fn_sig());
611611
let fn_ty = FnType::new(ccx, Abi::Rust, &sig, &[]);
612612

613-
let bcx = Builder::entry_block(ccx, llfn);
613+
let bcx = Builder::new_block(ccx, llfn, "entry-block");
614614
if !fn_ty.ret.is_ignore() {
615615
// But if there are no nested returns, we skip the indirection
616616
// and have a single retslot

src/librustc_trans/builder.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,6 @@ fn noname() -> *const c_char {
5151
}
5252

5353
impl<'a, 'tcx> Builder<'a, 'tcx> {
54-
pub fn entry_block(ccx: &'a CrateContext<'a, 'tcx>, llfn: ValueRef) -> Self {
55-
Builder::new_block(ccx, llfn, "entry-block")
56-
}
57-
5854
pub fn new_block<'b>(ccx: &'a CrateContext<'a, 'tcx>, llfn: ValueRef, name: &'b str) -> Self {
5955
let builder = Builder::with_ccx(ccx);
6056
let llbb = unsafe {

src/librustc_trans/callee.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ fn trans_fn_once_adapter_shim<'a, 'tcx>(
329329
attributes::set_frame_pointer_elimination(ccx, lloncefn);
330330

331331
let orig_fn_ty = fn_ty;
332-
let mut bcx = Builder::entry_block(ccx, lloncefn);
332+
let mut bcx = Builder::new_block(ccx, lloncefn, "entry-block");
333333

334334
let callee = Callee {
335335
data: Fn(llreffn),
@@ -489,7 +489,7 @@ fn trans_fn_pointer_shim<'a, 'tcx>(
489489
let llfn = declare::define_internal_fn(ccx, &function_name, tuple_fn_ty);
490490
attributes::set_frame_pointer_elimination(ccx, llfn);
491491
//
492-
let bcx = Builder::entry_block(ccx, llfn);
492+
let bcx = Builder::new_block(ccx, llfn, "entry-block");
493493

494494
let mut llargs = get_params(llfn);
495495

src/librustc_trans/glue.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ pub fn implement_drop_glue<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>, g: DropGlueKi
173173
assert_eq!(g.ty(), get_drop_glue_type(ccx.shared(), g.ty()));
174174
let (llfn, _) = ccx.drop_glues().borrow().get(&g).unwrap().clone();
175175

176-
let mut bcx = Builder::entry_block(ccx, llfn);
176+
let mut bcx = Builder::new_block(ccx, llfn, "entry-block");
177177

178178
ccx.stats().n_glues_created.set(ccx.stats().n_glues_created.get() + 1);
179179
// All glue functions take values passed *by alias*; this is a

src/librustc_trans/intrinsic.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -883,7 +883,7 @@ fn gen_fn<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>,
883883
sig: ty::Binder(sig)
884884
}));
885885
let llfn = declare::define_internal_fn(ccx, name, rust_fn_ty);
886-
let bcx = Builder::entry_block(ccx, llfn);
886+
let bcx = Builder::new_block(ccx, llfn, "entry-block");
887887
trans(bcx);
888888
llfn
889889
}

src/librustc_trans/meth.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ pub fn trans_object_shim<'a, 'tcx>(ccx: &'a CrateContext<'a, 'tcx>,
7676
let llfn = declare::define_internal_fn(ccx, &function_name, callee.ty);
7777
attributes::set_frame_pointer_elimination(ccx, llfn);
7878

79-
let bcx = Builder::entry_block(ccx, llfn);
79+
let bcx = Builder::new_block(ccx, llfn, "entry-block");
8080

8181
let mut llargs = get_params(llfn);
8282
let fn_ret = callee.ty.fn_ret();

src/librustc_trans/mir/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ pub fn trans_mir<'a, 'tcx: 'a>(
210210
debug!("fn_ty: {:?}", fn_ty);
211211
let debug_context =
212212
debuginfo::create_function_debug_context(ccx, instance, sig, abi, llfn, mir);
213-
let bcx = Builder::entry_block(ccx, llfn);
213+
let bcx = Builder::new_block(ccx, llfn, "entry-block");
214214

215215
let cleanup_kinds = analyze::cleanup_kinds(&mir);
216216

0 commit comments

Comments
 (0)