Skip to content
Browse files

PGO: Check that pgo-use file actually exists. LLVM seems to only emit…

… an easy-to-overlook warning otherwise.
  • Loading branch information...
michaelwoerister committed May 22, 2019
1 parent e943426 commit eeb7348dc3fbb0b85a7f45b5972e744085cb632d
Showing with 9 additions and 0 deletions.
  1. +9 −0 src/librustc/session/
@@ -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.",

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

0 comments on commit eeb7348

Please sign in to comment.
You can’t perform that action at this time.