FunctionCx: Fix field usage in inline_asm and vtable modules
MODIFY
src/inline_asm.rs
src/inline_asm.rs
@@ -73,7 +73,7 @@ pub(crate) fn codegen_inline_asm<'tcx>(
let asm_name = format!("{}__inline_asm_{}", fx.codegen_cx.tcx.symbol_name(fx.instance).name, inline_asm_index);
let generated_asm = generate_asm_wrapper(&asm_name, InlineAsmArch::X86_64, options, template, clobbered_regs, &inputs, &outputs);
- fx.global_asm.push_str(&generated_asm);
+ fx.codegen_cx.global_asm.push_str(&generated_asm);
call_inline_asm(fx, &asm_name, slot_size, inputs, outputs);
}

MODIFY
src/vtable.rs
src/vtable.rs
@@ -72,11 +72,11 @@ pub(crate) fn get_vtable<'tcx>(
layout: TyAndLayout<'tcx>,
trait_ref: Option<ty::PolyExistentialTraitRef<'tcx>>,
) -> Value {
- let data_id = if let Some(data_id) = fx.vtables.get(&(layout.ty, trait_ref)) {
+ let data_id = if let Some(data_id) = fx.codegen_cx.vtables.get(&(layout.ty, trait_ref)) {
*data_id
} else {
let data_id = build_vtable(fx, layout, trait_ref);
- fx.vtables.insert((layout.ty, trait_ref), data_id);
+ fx.codegen_cx.vtables.insert((layout.ty, trait_ref), data_id);
data_id
};
@@ -142,7 +142,7 @@ fn build_vtable<'tcx>(
.map(|trait_ref| format!("{:?}", trait_ref.skip_binder()).into())
.unwrap_or(std::borrow::Cow::Borrowed("???")),
layout.ty,
- fx.vtables.len(),
+ fx.codegen_cx.vtables.len(),
),
Linkage::Local,
false,

FunctionCx: Fix field usage in inline_asm and vtable modules