Skip to content

Commit

Permalink
Inline build_block
Browse files Browse the repository at this point in the history
  • Loading branch information
bjorn3 committed Feb 20, 2022
1 parent e142cdf commit 0edcf1e
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions compiler/rustc_codegen_ssa/src/mir/block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,8 @@ impl<'a, 'tcx> TerminatorCodegenHelper<'tcx> {
}

if let Some((ret_dest, target)) = destination {
let mut ret_bx = fx.build_block(target);
let target_llbb = fx.llbb(target);
let mut ret_bx = Bx::build(fx.cx, target_llbb);
fx.set_debug_loc(&mut ret_bx, self.terminator.source_info);
fx.store_return(&mut ret_bx, ret_dest, &fn_abi.ret, invokeret);
}
Expand Down Expand Up @@ -1023,7 +1024,8 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {

impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
pub fn codegen_block(&mut self, bb: mir::BasicBlock) {
let mut bx = self.build_block(bb);
let llbb = self.llbb(bb);
let mut bx = Bx::build(self.cx, llbb);
let mir = self.mir;
let data = &mir[bb];

Expand Down Expand Up @@ -1465,11 +1467,6 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
})
}

pub fn build_block(&mut self, bb: mir::BasicBlock) -> Bx {
let llbb = self.llbb(bb);
Bx::build(self.cx, llbb)
}

fn make_return_dest(
&mut self,
bx: &mut Bx,
Expand Down

0 comments on commit 0edcf1e

Please sign in to comment.