diff options
| author | bjorn3 <17426603+bjorn3@users.noreply.github.com> | 2025-05-25 18:51:16 +0000 | 
|---|---|---|
| committer | bjorn3 <17426603+bjorn3@users.noreply.github.com> | 2025-05-25 18:51:16 +0000 | 
| commit | 3816385b09db445ab580043ed45218df8c1198ad (patch) | |
| tree | 72c83caba4898e2393bf300c084aac0abb363271 /compiler/rustc_codegen_cranelift/src/driver/jit.rs | |
| parent | 283db70ace62a0ae704a624e43b68c2ee44b87a6 (diff) | |
| parent | 979dcf8e2f213e4f4b645cb62e7fe9f4f2c0c785 (diff) | |
| download | rust-3816385b09db445ab580043ed45218df8c1198ad.tar.gz rust-3816385b09db445ab580043ed45218df8c1198ad.zip  | |
Merge commit '979dcf8e2f213e4f4b645cb62e7fe9f4f2c0c785' into sync_cg_clif-2025-05-25
Diffstat (limited to 'compiler/rustc_codegen_cranelift/src/driver/jit.rs')
| -rw-r--r-- | compiler/rustc_codegen_cranelift/src/driver/jit.rs | 7 | 
1 files changed, 4 insertions, 3 deletions
diff --git a/compiler/rustc_codegen_cranelift/src/driver/jit.rs b/compiler/rustc_codegen_cranelift/src/driver/jit.rs index e368cf4386d..b1f185b551c 100644 --- a/compiler/rustc_codegen_cranelift/src/driver/jit.rs +++ b/compiler/rustc_codegen_cranelift/src/driver/jit.rs @@ -6,6 +6,7 @@ use std::os::raw::{c_char, c_int}; use cranelift_jit::{JITBuilder, JITModule}; use rustc_codegen_ssa::CrateInfo; +use rustc_middle::middle::codegen_fn_attrs::CodegenFnAttrFlags; use rustc_middle::mir::mono::MonoItem; use rustc_session::Session; use rustc_span::sym; @@ -84,7 +85,7 @@ pub(crate) fn run_jit(tcx: TyCtxt<'_>, jit_args: Vec<String>) -> ! { tcx.dcx().abort_if_errors(); - jit_module.finalize_definitions(); + let mut jit_module = jit_module.finalize_definitions(); println!( "Rustc codegen cranelift will JIT run the executable, because -Cllvm-args=mode=jit was passed" @@ -104,7 +105,7 @@ pub(crate) fn run_jit(tcx: TyCtxt<'_>, jit_args: Vec<String>) -> ! { call_conv: jit_module.target_config().default_call_conv, }; let start_func_id = jit_module.declare_function("main", Linkage::Import, &start_sig).unwrap(); - let finalized_start: *const u8 = jit_module.module.get_finalized_function(start_func_id); + let finalized_start: *const u8 = jit_module.get_finalized_function(start_func_id); let f: extern "C" fn(c_int, *const *const c_char) -> c_int = unsafe { ::std::mem::transmute(finalized_start) }; @@ -119,7 +120,7 @@ pub(crate) fn run_jit(tcx: TyCtxt<'_>, jit_args: Vec<String>) -> ! { std::process::exit(ret); } -pub(crate) fn codegen_and_compile_fn<'tcx>( +fn codegen_and_compile_fn<'tcx>( tcx: TyCtxt<'tcx>, cx: &mut crate::CodegenCx, cached_context: &mut Context,  | 
