Skip to content

Commit a7a1bf8

Browse files
committed
Move -Z lto to -C lto.
Closes #12443
1 parent d7e1bb5 commit a7a1bf8

File tree

9 files changed

+11
-11
lines changed

9 files changed

+11
-11
lines changed

src/librustc/driver/config.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,6 @@ debugging_opts!(
180180
GC,
181181
PRINT_LINK_ARGS,
182182
PRINT_LLVM_PASSES,
183-
LTO,
184183
AST_JSON,
185184
AST_JSON_NOEXPAND,
186185
LS,
@@ -219,7 +218,6 @@ pub fn debugging_opts_map() -> Vec<(&'static str, &'static str, u64)> {
219218
("print-llvm-passes",
220219
"Prints the llvm optimization passes being run",
221220
PRINT_LLVM_PASSES),
222-
("lto", "Perform LLVM link-time optimizations", LTO),
223221
("ast-json", "Print the AST as JSON and halt", AST_JSON),
224222
("ast-json-noexpand", "Print the pre-expansion AST as JSON and halt", AST_JSON_NOEXPAND),
225223
("ls", "List the symbols defined by a library crate", LS),
@@ -353,6 +351,8 @@ cgoptions!(
353351
"system linker to link outputs with"),
354352
link_args: Vec<String> = (Vec::new(), parse_list,
355353
"extra arguments to pass to the linker (space separated)"),
354+
lto: bool = (false, parse_bool,
355+
"perform LLVM link-time optimizations"),
356356
target_cpu: String = ("generic".to_string(), parse_string,
357357
"select target processor (llc -mcpu=help for details)"),
358358
target_feature: String = ("".to_string(), parse_string,

src/librustc/driver/session.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ impl Session {
168168
self.debugging_opt(config::PRINT_LLVM_PASSES)
169169
}
170170
pub fn lto(&self) -> bool {
171-
self.debugging_opt(config::LTO)
171+
self.opts.cg.lto
172172
}
173173
pub fn no_landing_pads(&self) -> bool {
174174
self.debugging_opt(config::NO_LANDING_PADS)

src/test/compile-fail/issue-11154.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
// compile-flags: -Z lto -C prefer-dynamic
11+
// compile-flags: -C lto -C prefer-dynamic
1212

1313
// error-pattern: cannot prefer dynamic linking
1414

src/test/debuginfo/cross-crate-type-uniquing.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
extern crate cross_crate_debuginfo_type_uniquing;
1515

1616
// no-prefer-dynamic
17-
// compile-flags:-g -Zlto
17+
// compile-flags:-g -C lto
1818

1919
pub struct C;
2020
pub fn p() -> C {

src/test/run-make/issue-14500/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
all:
1010
$(RUSTC) foo.rs --crate-type=rlib
11-
$(RUSTC) bar.rs --crate-type=staticlib -Zlto -L. -o $(TMPDIR)/libbar.a
11+
$(RUSTC) bar.rs --crate-type=staticlib -C lto -L. -o $(TMPDIR)/libbar.a
1212
$(CC) foo.c -lbar -o $(call RUN_BINFILE,foo) $(EXTRACFLAGS)
1313
$(call RUN,foo)
1414

src/test/run-make/lto-smoke-c/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44
CC := $(CC:-g=)
55

66
all:
7-
$(RUSTC) foo.rs -Z lto
7+
$(RUSTC) foo.rs -C lto
88
$(CC) bar.c -lfoo -o $(call RUN_BINFILE,bar) $(EXTRACFLAGS) -lstdc++
99
$(call RUN,bar)

src/test/run-make/lto-smoke/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22

33
all:
44
$(RUSTC) lib.rs
5-
$(RUSTC) main.rs -Z lto
5+
$(RUSTC) main.rs -C lto
66
$(call RUN,main)

src/test/run-make/lto-syntax-extension/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@ all: $(DOTEST)
1414
dotest:
1515
env
1616
$(RUSTC) lib.rs
17-
$(RUSTC) main.rs -Z lto
17+
$(RUSTC) main.rs -C lto
1818
$(call RUN,main)

src/test/run-pass/sepcomp-lib-lto.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
// Check that we can use `-Z lto` when linking against libraries that were
11+
// Check that we can use `-C lto` when linking against libraries that were
1212
// separately compiled.
1313

1414
// aux-build:sepcomp_lib.rs
15-
// compile-flags: -Z lto
15+
// compile-flags: -C lto
1616
// no-prefer-dynamic
1717

1818
extern crate sepcomp_lib;

0 commit comments

Comments
 (0)