diff options
Diffstat (limited to 'compiler/rustc_interface/src/interface.rs')
| -rw-r--r-- | compiler/rustc_interface/src/interface.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/compiler/rustc_interface/src/interface.rs b/compiler/rustc_interface/src/interface.rs index 4d84462c42b..73a51ad477b 100644 --- a/compiler/rustc_interface/src/interface.rs +++ b/compiler/rustc_interface/src/interface.rs @@ -154,6 +154,10 @@ pub struct Config { pub override_queries: Option<fn(&Session, &mut ty::query::Providers, &mut ty::query::Providers)>, + /// This is a callback from the driver that is called to create a codegen backend. + pub make_codegen_backend: + Option<Box<dyn FnOnce(&config::Options) -> Box<dyn CodegenBackend> + Send>>, + /// Registry of diagnostics codes. pub registry: Registry, } @@ -167,6 +171,7 @@ pub fn create_compiler_and_run<R>(config: Config, f: impl FnOnce(&Compiler) -> R config.file_loader, config.input_path.clone(), config.lint_caps, + config.make_codegen_backend, registry.clone(), ); |
