|
1 | 1 | use crate::dep_graph::{DepConstructor, DepNode, WorkProduct, WorkProductId}; |
2 | 2 | use crate::ich::{NodeIdHashingMode, StableHashingContext}; |
3 | 3 | use crate::ty::{subst::InternalSubsts, Instance, InstanceDef, SymbolName, TyCtxt}; |
4 | | -use rustc_attr::InlineAttr; |
5 | 4 | use rustc_data_structures::base_n; |
6 | 5 | use rustc_data_structures::fingerprint::Fingerprint; |
7 | 6 | use rustc_data_structures::fx::FxHashMap; |
@@ -103,17 +102,13 @@ impl<'tcx> MonoItem<'tcx> { |
103 | 102 | // inlined function. If we're inlining into all CGUs then we'll |
104 | 103 | // be creating a local copy per CGU. |
105 | 104 | if generate_cgu_internal_copies { |
106 | | - return InstantiationMode::LocalCopy; |
107 | | - } |
108 | | - |
109 | | - // Finally, if this is `#[inline(always)]` we're sure to respect |
110 | | - // that with an inline copy per CGU, but otherwise we'll be |
111 | | - // creating one copy of this `#[inline]` function which may |
112 | | - // conflict with upstream crates as it could be an exported |
113 | | - // symbol. |
114 | | - match tcx.codegen_fn_attrs(instance.def_id()).inline { |
115 | | - InlineAttr::Always => InstantiationMode::LocalCopy, |
116 | | - _ => InstantiationMode::GloballyShared { may_conflict: true }, |
| 105 | + InstantiationMode::LocalCopy |
| 106 | + } else { |
| 107 | + // Finally, if we've reached this point, then we should optimize for |
| 108 | + // compilation speed. In that regard, we will ignore any `#[inline]` |
| 109 | + // annotations on the function and simply codegen it as usual. This could |
| 110 | + // conflict with upstream crates as it could be an exported symbol. |
| 111 | + InstantiationMode::GloballyShared { may_conflict: true } |
117 | 112 | } |
118 | 113 | } |
119 | 114 | MonoItem::Static(..) | MonoItem::GlobalAsm(..) => { |
|
0 commit comments