Skip to content

Commit

Permalink
PGO: Check that pgo-use file actually exists. LLVM seems to only emit…
Browse files Browse the repository at this point in the history
… an easy-to-overlook warning otherwise.
  • Loading branch information
michaelwoerister committed May 27, 2019
1 parent e943426 commit eeb7348
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/librustc/session/mod.rs
Expand Up @@ -1272,6 +1272,15 @@ fn validate_commandline_args_with_session_available(sess: &Session) {
sess.err("Linker plugin based LTO is not supported together with \
`-C prefer-dynamic` when targeting MSVC");
}

// Make sure that any given profiling data actually exists so LLVM can't
// decide to silently skip PGO.
if let Some(ref path) = sess.opts.debugging_opts.pgo_use {
if !path.exists() {
sess.err(&format!("File `{}` passed to `-Zpgo-use` does not exist.",
path.display()));
}
}
}

/// Hash value constructed out of all the `-C metadata` arguments passed to the
Expand Down

0 comments on commit eeb7348

Please sign in to comment.