Remove special case in maybe_create_entry_wrapper

This commit is contained in:
bjorn3 2024-05-03 11:05:31 +00:00
parent c41a7db24f
commit 88d10687b0
2 changed files with 9 additions and 8 deletions

View File

@ -83,13 +83,6 @@ fn create_jit_module(
);
crate::allocator::codegen(tcx, &mut jit_module, &mut cx.unwind_context);
crate::main_shim::maybe_create_entry_wrapper(
tcx,
&mut jit_module,
&mut cx.unwind_context,
true,
true,
);
(jit_module, cx)
}
@ -153,6 +146,14 @@ pub(crate) fn run_jit(tcx: TyCtxt<'_>, backend_config: BackendConfig) -> ! {
tcx.dcx().fatal("Inline asm is not supported in JIT mode");
}
crate::main_shim::maybe_create_entry_wrapper(
tcx,
&mut jit_module,
&mut cx.unwind_context,
true,
true,
);
tcx.dcx().abort_if_errors();
jit_module.finalize_definitions().unwrap();

View File

@ -29,7 +29,7 @@ pub(crate) fn maybe_create_entry_wrapper(
if main_def_id.is_local() {
let instance = Instance::mono(tcx, main_def_id).polymorphize(tcx);
if !is_jit && module.get_name(tcx.symbol_name(instance).name).is_none() {
if module.get_name(tcx.symbol_name(instance).name).is_none() {
return;
}
} else if !is_primary_cgu {