FunctionCx: WIP: Fix overzealous sed usage
This commit is contained in:
parent
ad4a7a1f0c
commit
1a6365f95f
@ -49,7 +49,7 @@ pub(crate) fn trans_fn<'tcx, B: Backend + 'static>(
|
||||
cold_blocks: EntitySet::new(),
|
||||
|
||||
clif_comments,
|
||||
constants_cx: &mut cx.codegen_cx.constants_cx,
|
||||
constants_cx: &mut cx.constants_cx,
|
||||
vtables: &mut cx.vtables,
|
||||
source_info_set: indexmap::IndexSet::new(),
|
||||
next_ssa_var: 0,
|
||||
|
@ -265,7 +265,7 @@ pub(crate) fn type_sign(ty: Ty<'_>) -> bool {
|
||||
}
|
||||
|
||||
pub(crate) struct FunctionCx<'clif, 'tcx, B: Backend + 'static> {
|
||||
pub(crate) .codegen_cx: &'clif CodegenCx<'tcx, B>,
|
||||
pub(crate) codegen_cx: &'clif mut crate::CodegenCx<'tcx, B>,
|
||||
pub(crate) global_asm: &'clif mut String,
|
||||
pub(crate) pointer_type: Type, // Cached from module
|
||||
|
||||
|
@ -167,7 +167,7 @@ pub(crate) fn trans_const_value<'tcx>(
|
||||
let alloc_kind = fx.codegen_cx.tcx.get_global_alloc(ptr.alloc_id);
|
||||
let base_addr = match alloc_kind {
|
||||
Some(GlobalAlloc::Memory(alloc)) => {
|
||||
fx.codegen_cx.constants_cx.todo.push(TodoItem::Alloc(ptr.alloc_id));
|
||||
fx.constants_cx.todo.push(TodoItem::Alloc(ptr.alloc_id));
|
||||
let data_id = data_id_for_alloc_id(fx.codegen_cx.module, ptr.alloc_id, alloc.align, alloc.mutability);
|
||||
let local_data_id = fx.codegen_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 = fx.codegen_cx.tcx.create_memory_alloc(alloc);
|
||||
fx.codegen_cx.constants_cx.todo.push(TodoItem::Alloc(alloc_id));
|
||||
fx.constants_cx.todo.push(TodoItem::Alloc(alloc_id));
|
||||
let data_id = data_id_for_alloc_id(fx.codegen_cx.module, alloc_id, alloc.align, alloc.mutability);
|
||||
|
||||
let local_data_id = fx.codegen_cx.module.declare_data_in_func(data_id, &mut fx.bcx.func);
|
||||
|
@ -88,7 +88,7 @@ fn trans_mono_item<'tcx, B: Backend + 'static>(
|
||||
cx.codegen_cx.tcx.sess.time("codegen fn", || crate::base::trans_fn(cx, inst, linkage));
|
||||
}
|
||||
MonoItem::Static(def_id) => {
|
||||
crate::constant::codegen_static(&mut cx.codegen_cx.constants_cx, def_id);
|
||||
crate::constant::codegen_static(&mut cx.constants_cx, def_id);
|
||||
}
|
||||
MonoItem::GlobalAsm(hir_id) => {
|
||||
let item = tcx.hir().expect_item(hir_id);
|
||||
|
@ -160,7 +160,7 @@ fn new(
|
||||
}
|
||||
|
||||
fn finalize(mut self) -> (Module<B>, String, Option<DebugContext<'tcx>>, UnwindContext<'tcx>) {
|
||||
self.codegen_cx.constants_cx.finalize(self.codegen_cx.tcx, &mut self.codegen_cx.module);
|
||||
self.constants_cx.finalize(self.codegen_cx.tcx, &mut self.codegen_cx.module);
|
||||
(self.codegen_cx.module, self.global_asm, self.debug_context, self.unwind_context)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user