Remove Queries::ongoing_codegen.

There's no need to store it in `Queries`. We can just use a local
variable, because it's always used shortly after it's produced.

The commit also removes the `tcx.analysis()` call in `ongoing_codegen`,
because it's easy to ensure that's done beforehand.

All this makes the dataflow within `run_compiler` easier to follow, at
the cost of making one test slightly more verbose, which I think is a
good tradeoff.
This commit is contained in:
Nicholas Nethercote 2023-06-21 11:26:49 +10:00
parent c696307a87
commit 1da1348924
4 changed files with 21 additions and 27 deletions

View file

@ -424,7 +424,7 @@ fn run_compiler(
return early_exit();
}
queries.ongoing_codegen()?;
let ongoing_codegen = queries.ongoing_codegen()?;
if sess.opts.unstable_opts.print_type_sizes {
sess.code_stats.print_type_sizes();
@ -437,7 +437,7 @@ fn run_compiler(
sess.code_stats.print_vtable_sizes(crate_name);
}
let linker = queries.linker()?;
let linker = queries.linker(ongoing_codegen)?;
Ok(Some(linker))
})?;