INNER CODE UNIT · Rust
compile_codegen_unit
EmbarkStudios/rust-gpu · crates/rustc_codegen_spirv/src/lib.rs:402
fn compile_codegen_unit(
&self,
tcx: TyCtxt<'_>,
cgu_name: Symbol,
) -> (ModuleCodegen<Self::Module>, u64) {
let _timer = tcx
.prof
.verbose_generic_activity_with_arg("codegen_module", cgu_name.to_string());
// TODO: Do dep_graph stuff
let cgu = tcx.codegen_unit(cgu_name);
let cx = CodegenCx::new(tcx, cgu);
let do_codegen = || {
let mono_items = cx.codegen_unit.items_in_deterministic_order(cx.tcx);
if let Some(dir) = &cx.codegen_args.dump_mir {
dump_mir(tcx, mono_items.as_slice(), &dir.join(cgu_name.to_string()));