@@ -16,7 +16,7 @@ use rustc_span::Symbol;
1616use crate :: debuginfo:: TypeDebugContext ;
1717use crate :: prelude:: * ;
1818use crate :: unwind_module:: UnwindModule ;
19- use crate :: { BackendConfig , CodegenCx , CodegenMode } ;
19+ use crate :: { CodegenCx , CodegenMode } ;
2020
2121struct JitState {
2222 jit_module : UnwindModule < JITModule > ,
@@ -77,7 +77,7 @@ fn create_jit_module(tcx: TyCtxt<'_>, hotswap: bool) -> (UnwindModule<JITModule>
7777 ( jit_module, cx)
7878}
7979
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 > ) -> ! {
8181 if !tcx. sess . opts . output_types . should_codegen ( ) {
8282 tcx. dcx ( ) . fatal ( "JIT mode doesn't work with `cargo check`" ) ;
8383 }
@@ -87,7 +87,7 @@ pub(crate) fn run_jit(tcx: TyCtxt<'_>, backend_config: BackendConfig) -> ! {
8787 }
8888
8989 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 ) ) ;
9191 let mut cached_context = Context :: new ( ) ;
9292
9393 let ( _, cgus) = tcx. collect_and_partition_mono_items ( ( ) ) ;
@@ -103,7 +103,7 @@ pub(crate) fn run_jit(tcx: TyCtxt<'_>, backend_config: BackendConfig) -> ! {
103103 super :: predefine_mono_items ( tcx, & mut jit_module, & mono_items) ;
104104 for ( mono_item, _) in mono_items {
105105 match mono_item {
106- MonoItem :: Fn ( inst) => match backend_config . codegen_mode {
106+ MonoItem :: Fn ( inst) => match codegen_mode {
107107 CodegenMode :: Aot => unreachable ! ( ) ,
108108 CodegenMode :: Jit => {
109109 codegen_and_compile_fn (
@@ -144,7 +144,7 @@ pub(crate) fn run_jit(tcx: TyCtxt<'_>, backend_config: BackendConfig) -> ! {
144144 ) ;
145145
146146 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) )
148148 . map ( |arg| CString :: new ( arg) . unwrap ( ) )
149149 . collect :: < Vec < _ > > ( ) ;
150150
0 commit comments