Skip to content

Commit

Permalink
Disable inline_in_all_cgus when LTO is enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
ishitatsuyuki committed Oct 4, 2019
1 parent c97f5f0 commit 3e0a02a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/librustc/mir/mono.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use crate::dep_graph::{WorkProductId, DepNode, WorkProduct, DepConstructor};
use rustc_data_structures::base_n;
use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
use crate::ich::{Fingerprint, StableHashingContext, NodeIdHashingMode};
use crate::session::config::OptLevel;
use crate::session::config::{OptLevel, Lto};
use std::fmt;
use std::hash::Hash;

Expand Down Expand Up @@ -89,7 +89,7 @@ impl<'tcx> MonoItem<'tcx> {
pub fn instantiation_mode(&self, tcx: TyCtxt<'tcx>) -> InstantiationMode {
let inline_in_all_cgus =
tcx.sess.opts.debugging_opts.inline_in_all_cgus.unwrap_or_else(|| {
tcx.sess.opts.optimize != OptLevel::No
tcx.sess.opts.optimize != OptLevel::No && tcx.sess.lto() == Lto::No
}) && !tcx.sess.opts.cg.link_dead_code;

match *self {
Expand Down

0 comments on commit 3e0a02a

Please sign in to comment.