Inline write_dep_info query
This commit is contained in:
parent
391bdb3c12
commit
7332e79d5f
4 changed files with 9 additions and 12 deletions
|
@ -30,7 +30,7 @@ use rustc_errors::{
|
||||||
};
|
};
|
||||||
use rustc_feature::find_gated_cfg;
|
use rustc_feature::find_gated_cfg;
|
||||||
use rustc_interface::util::{self, get_codegen_backend};
|
use rustc_interface::util::{self, get_codegen_backend};
|
||||||
use rustc_interface::{interface, Queries};
|
use rustc_interface::{interface, passes, Queries};
|
||||||
use rustc_lint::unerased_lint_store;
|
use rustc_lint::unerased_lint_store;
|
||||||
use rustc_metadata::creader::MetadataLoader;
|
use rustc_metadata::creader::MetadataLoader;
|
||||||
use rustc_metadata::locator;
|
use rustc_metadata::locator;
|
||||||
|
@ -399,7 +399,9 @@ fn run_compiler(
|
||||||
Ok(())
|
Ok(())
|
||||||
})?;
|
})?;
|
||||||
|
|
||||||
queries.write_dep_info()?;
|
queries.global_ctxt()?.enter(|tcx| {
|
||||||
|
passes::write_dep_info(tcx);
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
let krate = queries.parse()?;
|
let krate = queries.parse()?;
|
||||||
pretty::print(
|
pretty::print(
|
||||||
|
@ -427,7 +429,9 @@ fn run_compiler(
|
||||||
return early_exit();
|
return early_exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
queries.write_dep_info()?;
|
queries.global_ctxt()?.enter(|tcx| {
|
||||||
|
passes::write_dep_info(tcx);
|
||||||
|
});
|
||||||
|
|
||||||
if sess.opts.output_types.contains_key(&OutputType::DepInfo)
|
if sess.opts.output_types.contains_key(&OutputType::DepInfo)
|
||||||
&& sess.opts.output_types.len() == 1
|
&& sess.opts.output_types.len() == 1
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
mod callbacks;
|
mod callbacks;
|
||||||
mod errors;
|
mod errors;
|
||||||
pub mod interface;
|
pub mod interface;
|
||||||
mod passes;
|
pub mod passes;
|
||||||
mod proc_macro_decls;
|
mod proc_macro_decls;
|
||||||
mod queries;
|
mod queries;
|
||||||
pub mod util;
|
pub mod util;
|
||||||
|
|
|
@ -562,7 +562,7 @@ fn resolver_for_lowering_raw<'tcx>(
|
||||||
(tcx.arena.alloc(Steal::new((untracked_resolver_for_lowering, Lrc::new(krate)))), resolutions)
|
(tcx.arena.alloc(Steal::new((untracked_resolver_for_lowering, Lrc::new(krate)))), resolutions)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub(crate) fn write_dep_info(tcx: TyCtxt<'_>) {
|
pub fn write_dep_info(tcx: TyCtxt<'_>) {
|
||||||
// Make sure name resolution and macro expansion is run for
|
// Make sure name resolution and macro expansion is run for
|
||||||
// the side-effect of providing a complete set of all
|
// the side-effect of providing a complete set of all
|
||||||
// accessed files and env vars.
|
// accessed files and env vars.
|
||||||
|
|
|
@ -117,13 +117,6 @@ impl<'tcx> Queries<'tcx> {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn write_dep_info(&'tcx self) -> Result<()> {
|
|
||||||
self.global_ctxt()?.enter(|tcx| {
|
|
||||||
passes::write_dep_info(tcx);
|
|
||||||
});
|
|
||||||
Ok(())
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn codegen_and_build_linker(&'tcx self) -> Result<Linker> {
|
pub fn codegen_and_build_linker(&'tcx self) -> Result<Linker> {
|
||||||
self.global_ctxt()?.enter(|tcx| {
|
self.global_ctxt()?.enter(|tcx| {
|
||||||
let ongoing_codegen = passes::start_codegen(&*self.compiler.codegen_backend, tcx)?;
|
let ongoing_codegen = passes::start_codegen(&*self.compiler.codegen_backend, tcx)?;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue