Skip to content

Commit

Permalink
Inline and remove numbered_codegen_unit_name.
Browse files Browse the repository at this point in the history
It is small and has a single call site, and this change will facilitate
the next commit.
  • Loading branch information
nnethercote committed May 24, 2023
1 parent 8b4b208 commit e26c0c9
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions compiler/rustc_monomorphize/src/partitioning/merging.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,14 +98,9 @@ pub fn merge_codegen_units<'tcx>(
// If we are compiling non-incrementally we just generate simple CGU
// names containing an index.
for (index, cgu) in codegen_units.iter_mut().enumerate() {
cgu.set_name(numbered_codegen_unit_name(cgu_name_builder, index));
let numbered_codegen_unit_name =
cgu_name_builder.build_cgu_name_no_mangle(LOCAL_CRATE, &["cgu"], Some(index));
cgu.set_name(numbered_codegen_unit_name);
}
}
}

fn numbered_codegen_unit_name(
name_builder: &mut CodegenUnitNameBuilder<'_>,
index: usize,
) -> Symbol {
name_builder.build_cgu_name_no_mangle(LOCAL_CRATE, &["cgu"], Some(index))
}

0 comments on commit e26c0c9

Please sign in to comment.