Skip to content

Commit e31addf

Browse files
committed
librustc_trans: Gate the preinliner with another -Z flag.
Signed-off-by: Emilio Cobos Álvarez <[email protected]>
1 parent 688275a commit e31addf

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/librustc/session/config.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1254,6 +1254,9 @@ options! {DebuggingOptions, DebuggingSetter, basic_debugging_options,
12541254
location if it's empty."),
12551255
pgo_use: String = (String::new(), parse_string, [TRACKED],
12561256
"Use PGO profile data from the given profile file."),
1257+
disable_instrumentation_preinliner: bool =
1258+
(false, parse_bool, [TRACKED], "Disable the instrumentation pre-inliner, \
1259+
useful for profiling / PGO."),
12571260
relro_level: Option<RelroLevel> = (None, parse_relro_level, [TRACKED],
12581261
"choose which RELRO level to use"),
12591262
nll: bool = (false, parse_bool, [UNTRACKED],

src/librustc_trans/llvm_util.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,9 @@ unsafe fn configure_llvm(sess: &Session) {
6161
add("rustc"); // fake program name
6262
if sess.time_llvm_passes() { add("-time-passes"); }
6363
if sess.print_llvm_passes() { add("-debug-pass=Structure"); }
64-
add("-disable-preinline");
64+
if sess.opts.debugging_opts.disable_instrumentation_preinliner {
65+
add("-disable-preinline");
66+
}
6567

6668
for arg in &sess.opts.cg.llvm_args {
6769
add(&(*arg));

0 commit comments

Comments
 (0)