@@ -16,7 +16,7 @@ use rustc_span::Symbol;
16
16
use crate :: debuginfo:: TypeDebugContext ;
17
17
use crate :: prelude:: * ;
18
18
use crate :: unwind_module:: UnwindModule ;
19
- use crate :: { BackendConfig , CodegenCx , CodegenMode } ;
19
+ use crate :: { CodegenCx , CodegenMode } ;
20
20
21
21
struct JitState {
22
22
jit_module : UnwindModule < JITModule > ,
@@ -77,7 +77,7 @@ fn create_jit_module(tcx: TyCtxt<'_>, hotswap: bool) -> (UnwindModule<JITModule>
77
77
( jit_module, cx)
78
78
}
79
79
80
- pub ( crate ) fn run_jit ( tcx : TyCtxt < ' _ > , backend_config : BackendConfig ) -> ! {
80
+ pub ( crate ) fn run_jit ( tcx : TyCtxt < ' _ > , codegen_mode : CodegenMode , jit_args : Vec < String > ) -> ! {
81
81
if !tcx. sess . opts . output_types . should_codegen ( ) {
82
82
tcx. dcx ( ) . fatal ( "JIT mode doesn't work with `cargo check`" ) ;
83
83
}
@@ -87,7 +87,7 @@ pub(crate) fn run_jit(tcx: TyCtxt<'_>, backend_config: BackendConfig) -> ! {
87
87
}
88
88
89
89
let ( mut jit_module, mut cx) =
90
- create_jit_module ( tcx, matches ! ( backend_config . codegen_mode, CodegenMode :: JitLazy ) ) ;
90
+ create_jit_module ( tcx, matches ! ( codegen_mode, CodegenMode :: JitLazy ) ) ;
91
91
let mut cached_context = Context :: new ( ) ;
92
92
93
93
let ( _, cgus) = tcx. collect_and_partition_mono_items ( ( ) ) ;
@@ -103,7 +103,7 @@ pub(crate) fn run_jit(tcx: TyCtxt<'_>, backend_config: BackendConfig) -> ! {
103
103
super :: predefine_mono_items ( tcx, & mut jit_module, & mono_items) ;
104
104
for ( mono_item, _) in mono_items {
105
105
match mono_item {
106
- MonoItem :: Fn ( inst) => match backend_config . codegen_mode {
106
+ MonoItem :: Fn ( inst) => match codegen_mode {
107
107
CodegenMode :: Aot => unreachable ! ( ) ,
108
108
CodegenMode :: Jit => {
109
109
codegen_and_compile_fn (
@@ -144,7 +144,7 @@ pub(crate) fn run_jit(tcx: TyCtxt<'_>, backend_config: BackendConfig) -> ! {
144
144
) ;
145
145
146
146
let args = std:: iter:: once ( & * tcx. crate_name ( LOCAL_CRATE ) . as_str ( ) . to_string ( ) )
147
- . chain ( backend_config . jit_args . iter ( ) . map ( |arg| & * * arg) )
147
+ . chain ( jit_args. iter ( ) . map ( |arg| & * * arg) )
148
148
. map ( |arg| CString :: new ( arg) . unwrap ( ) )
149
149
. collect :: < Vec < _ > > ( ) ;
150
150
0 commit comments