Auto merge of #45944 - eddyb:provide, r=nikomatsakis
rustc_driver: expose a way to override query providers in CompileController. This API has been a long-time coming and will probably become the main method for custom drivers (that is, binaries other than `rustc` itself that use `librustc_driver`) to adapt the compiler's behavior.
This commit is contained in:
commit
3707db9405
11 changed files with 65 additions and 80 deletions
|
|
@ -154,9 +154,9 @@ pub fn run_core(search_paths: SearchPaths,
|
|||
target_features::add_configuration(&mut cfg, &sess);
|
||||
sess.parse_sess.config = cfg;
|
||||
|
||||
let krate = panictry!(driver::phase_1_parse_input(&driver::CompileController::basic(),
|
||||
&sess,
|
||||
&input));
|
||||
let control = &driver::CompileController::basic();
|
||||
|
||||
let krate = panictry!(driver::phase_1_parse_input(control, &sess, &input));
|
||||
let krate = ReplaceBodyWithLoop::new().fold_crate(krate);
|
||||
|
||||
let name = link::find_crate_name(Some(&sess), &krate.attrs, &input);
|
||||
|
|
@ -182,7 +182,8 @@ pub fn run_core(search_paths: SearchPaths,
|
|||
&[],
|
||||
&sess);
|
||||
|
||||
abort_on_err(driver::phase_3_run_analysis_passes(&sess,
|
||||
abort_on_err(driver::phase_3_run_analysis_passes(control,
|
||||
&sess,
|
||||
&*cstore,
|
||||
hir_map,
|
||||
analysis,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue