diff --git a/src/base.rs b/src/base.rs index bb7ee9e995b..1466ae9f828 100644 --- a/src/base.rs +++ b/src/base.rs @@ -49,7 +49,7 @@ pub(crate) fn trans_fn<'tcx, B: Backend + 'static>( cold_blocks: EntitySet::new(), clif_comments, - constants_cx: &mut cx.constants_cx, + constants_cx: &mut cxcodegen_cx.constants_cx, vtables: &mut cx.vtables, source_info_set: indexmap::IndexSet::new(), next_ssa_var: 0, diff --git a/src/constant.rs b/src/constant.rs index 0f84982cb3e..1eb6042b0b2 100644 --- a/src/constant.rs +++ b/src/constant.rs @@ -167,7 +167,7 @@ pub(crate) fn trans_const_value<'tcx>( let alloc_kind = fxcodegen_cx.tcx.get_global_alloc(ptr.alloc_id); let base_addr = match alloc_kind { Some(GlobalAlloc::Memory(alloc)) => { - fx.constants_cx.todo.push(TodoItem::Alloc(ptr.alloc_id)); + fxcodegen_cx.constants_cx.todo.push(TodoItem::Alloc(ptr.alloc_id)); let data_id = data_id_for_alloc_id(fxcodegen_cx.module, ptr.alloc_id, alloc.align, alloc.mutability); let local_data_id = fxcodegen_cx.module.declare_data_in_func(data_id, &mut fx.bcx.func); #[cfg(debug_assertions)] @@ -216,7 +216,7 @@ fn pointer_for_allocation<'tcx>( alloc: &'tcx Allocation, ) -> crate::pointer::Pointer { let alloc_id = fxcodegen_cx.tcx.create_memory_alloc(alloc); - fx.constants_cx.todo.push(TodoItem::Alloc(alloc_id)); + fxcodegen_cx.constants_cx.todo.push(TodoItem::Alloc(alloc_id)); let data_id = data_id_for_alloc_id(fxcodegen_cx.module, alloc_id, alloc.align, alloc.mutability); let local_data_id = fxcodegen_cx.module.declare_data_in_func(data_id, &mut fx.bcx.func); diff --git a/src/driver/mod.rs b/src/driver/mod.rs index ceb0f169f07..ab397d7c7fd 100644 --- a/src/driver/mod.rs +++ b/src/driver/mod.rs @@ -88,7 +88,7 @@ fn trans_mono_item<'tcx, B: Backend + 'static>( cxcodegen_cx.tcx.sess.time("codegen fn", || crate::base::trans_fn(cx, inst, linkage)); } MonoItem::Static(def_id) => { - crate::constant::codegen_static(&mut cx.constants_cx, def_id); + crate::constant::codegen_static(&mut cxcodegen_cx.constants_cx, def_id); } MonoItem::GlobalAsm(hir_id) => { let item = tcx.hir().expect_item(hir_id); diff --git a/src/lib.rs b/src/lib.rs index 269c66e8b0c..9ab9ad8c81a 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -160,7 +160,7 @@ impl<'tcx, B: Backend + 'static> CodegenCx<'tcx, B> { } fn finalize(mut self) -> (Module, String, Option>, UnwindContext<'tcx>) { - self.constants_cx.finalize(selfcodegen_cx.tcx, &mut selfcodegen_cx.module); + selfcodegen_cx.constants_cx.finalize(selfcodegen_cx.tcx, &mut selfcodegen_cx.module); (selfcodegen_cx.module, self.global_asm, self.debug_context, self.unwind_context) } }