From 0edcf1e2496caed074187c3c5ffac14537e633cf Mon Sep 17 00:00:00 2001 From: bjorn3 Date: Fri, 18 Feb 2022 15:38:27 +0100 Subject: [PATCH] Inline build_block --- compiler/rustc_codegen_ssa/src/mir/block.rs | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/compiler/rustc_codegen_ssa/src/mir/block.rs b/compiler/rustc_codegen_ssa/src/mir/block.rs index f3d41f3f86c..ca46d230b72 100644 --- a/compiler/rustc_codegen_ssa/src/mir/block.rs +++ b/compiler/rustc_codegen_ssa/src/mir/block.rs @@ -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); } @@ -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]; @@ -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,