MonoItem::Static(def_id) => {
crate::constant::codegen_static(&mut cx.constants_cx, def_id);
}
- MonoItem::GlobalAsm(hir_id) => {
- let item = cx.tcx.hir().expect_item(hir_id);
- tcx.sess
- .span_fatal(item.span, "Global asm is not supported in JIT mode");
+ MonoItem::GlobalAsm(item_id) => {
+ let item = cx.tcx.hir().item(item_id);
+ tcx.sess.span_fatal(item.span, "Global asm is not supported in JIT mode");
}
}
}
let jit_module = jit_module.as_mut().unwrap();
let mut cx = crate::CodegenCx::new(tcx, jit_module, false, false);
- let (name, sig) = crate::abi::get_function_name_and_sig(
- tcx,
- cx.module.isa().triple(),
- instance,
- true,
- );
+ let name = tcx.symbol_name(instance).name.to_string();
+ let sig = crate::abi::get_function_sig(tcx, cx.module.isa().triple(), instance);
let func_id = cx
.module
.declare_function(&name, Linkage::Export, &sig)
let pointer_type = cx.module.target_config().pointer_type();
- let (name, sig) =
- crate::abi::get_function_name_and_sig(tcx, cx.module.isa().triple(), inst, true);
+ let name = tcx.symbol_name(inst).name.to_string();
+ let sig = crate::abi::get_function_sig(tcx, cx.module.isa().triple(), inst);
let func_id = cx
.module
.declare_function(&name, Linkage::Export, &sig)