Skip to content

Commit 2c80a2f

Browse files
committed
Slightly improve comment in produce_final_output_artifacts
It is still not entirely correct I think, but much closer to the current way things are done.
1 parent 1651079 commit 2c80a2f

1 file changed

Lines changed: 9 additions & 12 deletions

File tree

  • compiler/rustc_codegen_ssa/src/back

compiler/rustc_codegen_ssa/src/back/write.rs

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -598,30 +598,28 @@ pub fn produce_final_output_artifacts(
598598
// Clean up unwanted temporary files.
599599

600600
// We create the following files by default:
601-
// - #crate#.#module-name#.bc
602-
// - #crate#.#module-name#.o
603-
// - #crate#.crate.metadata.bc
604-
// - #crate#.crate.metadata.o
605-
// - #crate#.o (linked from crate.##.o)
606-
// - #crate#.bc (copied from crate.##.bc)
601+
// - #crate#.#module-name#.rcgu.bc
602+
// - #crate#.#module-name#.rcgu.o
603+
// - #crate#.o (linked from crate.##.rcgu.o)
604+
// - #crate#.bc (copied from crate.##.rcgu.bc)
607605
// We may create additional files if requested by the user (through
608606
// `-C save-temps` or `--emit=` flags).
609607

610608
if !sess.opts.cg.save_temps {
611-
// Remove the temporary .#module-name#.o objects. If the user didn't
609+
// Remove the temporary .#module-name#.rcgu.o objects. If the user didn't
612610
// explicitly request bitcode (with --emit=bc), and the bitcode is not
613611
// needed for building an rlib, then we must remove .#module-name#.bc as
614612
// well.
615613

616-
// Specific rules for keeping .#module-name#.bc:
614+
// Specific rules for keeping .#module-name#.rcgu.bc:
617615
// - If the user requested bitcode (`user_wants_bitcode`), and
618616
// codegen_units > 1, then keep it.
619617
// - If the user requested bitcode but codegen_units == 1, then we
620-
// can toss .#module-name#.bc because we copied it to .bc earlier.
618+
// can toss .#module-name#.rcgu.bc because we copied it to .bc earlier.
621619
// - If we're not building an rlib and the user didn't request
622-
// bitcode, then delete .#module-name#.bc.
620+
// bitcode, then delete .#module-name#.rcgu.bc.
623621
// If you change how this works, also update back::link::link_rlib,
624-
// where .#module-name#.bc files are (maybe) deleted after making an
622+
// where .#module-name#.rcgu.bc files are (maybe) deleted after making an
625623
// rlib.
626624
let needs_crate_object = crate_output.outputs.contains_key(&OutputType::Exe);
627625

@@ -681,7 +679,6 @@ pub fn produce_final_output_artifacts(
681679

682680
// We leave the following files around by default:
683681
// - #crate#.o
684-
// - #crate#.crate.metadata.o
685682
// - #crate#.bc
686683
// These are used in linking steps and will be cleaned up afterward.
687684
}

0 commit comments

Comments
 (0)