diff --git a/src/builder.rs b/src/builder.rs index f5ee9db80a0..0b673f3e91b 100644 --- a/src/builder.rs +++ b/src/builder.rs @@ -379,9 +379,7 @@ impl<'gcc, 'tcx> BackendTypes for Builder<'_, 'gcc, 'tcx> { impl<'a, 'gcc, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'gcc, 'tcx> { fn build(cx: &'a CodegenCx<'gcc, 'tcx>, block: Block<'gcc>) -> Self { - let bx = Builder::with_cx(cx, block); - *cx.current_block.borrow_mut() = Some(block); - bx + Builder::with_cx(cx, block) } fn llbb(&self) -> Block<'gcc> { @@ -399,7 +397,6 @@ fn append_sibling_block(&mut self, name: &str) -> Block<'gcc> { } fn switch_to_block(&mut self, block: Self::BasicBlock) { - *self.cx.current_block.borrow_mut() = Some(block); self.block = block; } diff --git a/src/context.rs b/src/context.rs index 795966d8183..91259836f6d 100644 --- a/src/context.rs +++ b/src/context.rs @@ -31,8 +31,7 @@ pub struct CodegenCx<'gcc, 'tcx> { pub codegen_unit: &'tcx CodegenUnit<'tcx>, pub context: &'gcc Context<'gcc>, - // TODO(antoyo): First set it to a dummy block to avoid using Option? - pub current_block: RefCell>>, + // TODO(bjorn3): First set it to a dummy function to avoid using Option? pub current_func: RefCell>>, pub normal_function_addresses: RefCell>>, @@ -177,7 +176,6 @@ pub fn new(context: &'gcc Context<'gcc>, codegen_unit: &'tcx CodegenUnit<'tcx>, check_overflow, codegen_unit, context, - current_block: RefCell::new(None), current_func: RefCell::new(None), normal_function_addresses: Default::default(), functions: RefCell::new(functions),