Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions src/librustc/session/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -807,9 +807,15 @@ impl Session {
return enabled
}

// If there's only one codegen unit and LTO isn't enabled then there's
// no need for ThinLTO so just return false.
if self.codegen_units() == 1 && !self.lto() {
// If LTO is enabled we right now unconditionally disable ThinLTO.
// This'll come at a later date! (full crate graph ThinLTO)
if self.lto() {
return false
}

// If there's only one codegen unit or then there's no need for ThinLTO
// so just return false.
if self.codegen_units() == 1 {
return false
}

Expand Down