Skip to content

Commit bf9df97

Browse files
committed
Remove -Zinline-in-all-cgus and clean up CGU partitioning tests
1 parent ed43cbc commit bf9df97

34 files changed

+187
-367
lines changed

compiler/rustc_interface/src/tests.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -795,7 +795,6 @@ fn test_unstable_options_tracking_hash() {
795795
tracked!(function_sections, Some(false));
796796
tracked!(human_readable_cgu_names, true);
797797
tracked!(incremental_ignore_spans, true);
798-
tracked!(inline_in_all_cgus, Some(true));
799798
tracked!(inline_mir, Some(true));
800799
tracked!(inline_mir_hint_threshold, Some(123));
801800
tracked!(inline_mir_threshold, Some(123));

compiler/rustc_middle/src/mir/mono.rs

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -91,13 +91,8 @@ impl<'tcx> MonoItem<'tcx> {
9191
}
9292

9393
pub fn instantiation_mode(&self, tcx: TyCtxt<'tcx>) -> InstantiationMode {
94-
let generate_cgu_internal_copies = tcx
95-
.sess
96-
.opts
97-
.unstable_opts
98-
.inline_in_all_cgus
99-
.unwrap_or_else(|| tcx.sess.opts.optimize != OptLevel::No)
100-
&& !tcx.sess.link_dead_code();
94+
let generate_cgu_internal_copies =
95+
(tcx.sess.opts.optimize != OptLevel::No) && !tcx.sess.link_dead_code();
10196

10297
match *self {
10398
MonoItem::Fn(ref instance) => {
@@ -121,8 +116,8 @@ impl<'tcx> MonoItem<'tcx> {
121116
}
122117

123118
// At this point we don't have explicit linkage and we're an
124-
// inlined function. If we're inlining into all CGUs then we'll
125-
// be creating a local copy per CGU.
119+
// inlined function. If this crate's build settings permit,
120+
// we'll be creating a local copy per CGU.
126121
if generate_cgu_internal_copies {
127122
return InstantiationMode::LocalCopy;
128123
}

compiler/rustc_session/src/options.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1870,8 +1870,6 @@ options! {
18701870
"verify extended properties for incr. comp. (default: no):
18711871
- hashes of green query instances
18721872
- hash collisions of query keys"),
1873-
inline_in_all_cgus: Option<bool> = (None, parse_opt_bool, [TRACKED],
1874-
"control whether `#[inline]` functions are in all CGUs"),
18751873
inline_llvm: bool = (true, parse_bool, [TRACKED],
18761874
"enable LLVM inlining (default: yes)"),
18771875
inline_mir: Option<bool> = (None, parse_opt_bool, [TRACKED],

tests/codegen-units/item-collection/drop_in_place_intrinsic.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
//
21
//@ compile-flags:-Zprint-mono-items=eager
3-
//@ compile-flags:-Zinline-in-all-cgus
42
//@ compile-flags:-Zinline-mir=no
3+
//@ compile-flags: -O
54

65
#![crate_type = "lib"]
76

tests/codegen-units/item-collection/generic-drop-glue.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
//
21
//@ compile-flags:-Zprint-mono-items=eager
3-
//@ compile-flags:-Zinline-in-all-cgus
2+
//@ compile-flags: -O
43

54
#![deny(dead_code)]
65
#![crate_type = "lib"]

tests/codegen-units/item-collection/instantiation-through-vtable.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
//
2-
//@ compile-flags:-Zprint-mono-items=eager -Zinline-in-all-cgus -Zmir-opt-level=0
1+
//@ compile-flags:-Zprint-mono-items=eager -Zmir-opt-level=0
32

43
#![deny(dead_code)]
54
#![crate_type = "lib"]

tests/codegen-units/item-collection/non-generic-drop-glue.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
//
21
//@ compile-flags:-Zprint-mono-items=eager
3-
//@ compile-flags:-Zinline-in-all-cgus
2+
//@ compile-flags: -O
43

54
#![deny(dead_code)]
65
#![crate_type = "lib"]

tests/codegen-units/item-collection/transitive-drop-glue.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
//
21
//@ compile-flags:-Zprint-mono-items=eager
3-
//@ compile-flags:-Zinline-in-all-cgus
2+
//@ compile-flags: -O
43

54
#![deny(dead_code)]
65
#![crate_type = "lib"]

tests/codegen-units/item-collection/tuple-drop-glue.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
//
21
//@ compile-flags:-Zprint-mono-items=eager
3-
//@ compile-flags:-Zinline-in-all-cgus
2+
//@ compile-flags: -O
43

54
#![deny(dead_code)]
65
#![crate_type = "lib"]

tests/codegen-units/item-collection/unsizing.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
//@ compile-flags:-Zprint-mono-items=eager
2-
//@ compile-flags:-Zinline-in-all-cgus
32
//@ compile-flags:-Zmir-opt-level=0
43

54
#![deny(dead_code)]

0 commit comments

Comments
 (0)