Skip to content

Commit 952ec7d

Browse files
authored
Rollup merge of rust-lang#76474 - bjorn3:driver_selected_codegen, r=oli-obk
Add option to pass a custom codegen backend from a driver This allows the driver to pass information to the codegen backend. For example the headcrab debugger may in the future want to use cg_clif to JIT code to be injected in the debuggee. This would PR make it possible to tell cg_clif which symbol can be found at which address and to tell it to inject the JITed code into the right process. This PR may also help with rust-lang/miri#1540 by allowing miri to provide a codegen backend that only emits metadata and doesn't perform any codegen. cc @nbaksalyar (headcrab) cc @RalfJung (miri)
2 parents 7072e45 + 210e891 commit 952ec7d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/driver.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ pub fn main() {
357357
args.extend(vec!["--sysroot".into(), sys_root]);
358358
};
359359

360-
return rustc_driver::run_compiler(&args, &mut DefaultCallbacks, None, None);
360+
return rustc_driver::run_compiler(&args, &mut DefaultCallbacks, None, None, None);
361361
}
362362

363363
if orig_args.iter().any(|a| a == "--version" || a == "-V") {
@@ -420,6 +420,6 @@ pub fn main() {
420420
let mut default = DefaultCallbacks;
421421
let callbacks: &mut (dyn rustc_driver::Callbacks + Send) =
422422
if clippy_enabled { &mut clippy } else { &mut default };
423-
rustc_driver::run_compiler(&args, callbacks, None, None)
423+
rustc_driver::run_compiler(&args, callbacks, None, None, None)
424424
}))
425425
}

0 commit comments

Comments
 (0)