Skip to content

Commit

Permalink
Rollup merge of #84365 - vext01:improve-lto-docstrings, r=petrochenkov
Browse files Browse the repository at this point in the history
Improve the docstrings of the `Lto` struct.

This change is the result of [this zulip discussion](https://rust-lang.zulipchat.com/#narrow/stream/182449-t-compiler.2Fhelp/topic/Making.20sense.20of.20LTO.20modes.20in.20rustc).

Hopefully it makes things a little clearer. What do you think?
  • Loading branch information
GuillaumeGomez committed Apr 20, 2021
2 parents d6a2b03 + 8cc918a commit b58e1f2
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions compiler/rustc_session/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,19 +75,21 @@ impl_stable_hash_via_hash!(OptLevel);

/// This is what the `LtoCli` values get mapped to after resolving defaults and
/// and taking other command line options into account.
///
/// Note that linker plugin-based LTO is a different mechanism entirely.
#[derive(Clone, PartialEq)]
pub enum Lto {
/// Don't do any LTO whatsoever
/// Don't do any LTO whatsoever.
No,

/// Do a full crate graph LTO with ThinLTO
/// Do a full-crate-graph (inter-crate) LTO with ThinLTO.
Thin,

/// Do a local graph LTO with ThinLTO (only relevant for multiple codegen
/// units).
/// Do a local ThinLTO (intra-crate, over the CodeGen Units of the local crate only). This is
/// only relevant if multiple CGUs are used.
ThinLocal,

/// Do a full crate graph LTO with "fat" LTO
/// Do a full-crate-graph (inter-crate) LTO with "fat" LTO.
Fat,
}

Expand Down

0 comments on commit b58e1f2

Please sign in to comment.