Skip to content

Commit 50a3872

Browse files
committed
rustc_metadata: Load the profiler runtime if we're generating PGO profile data.
This contains all the actual profiling code. Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
1 parent 804f959 commit 50a3872

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/librustc_metadata/creader.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -784,7 +784,9 @@ impl<'a> CrateLoader<'a> {
784784
}
785785

786786
fn inject_profiler_runtime(&mut self) {
787-
if self.sess.opts.debugging_opts.profile {
787+
if self.sess.opts.debugging_opts.profile ||
788+
self.sess.opts.cg.pgo_gen.is_some()
789+
{
788790
info!("loading profiler");
789791

790792
let symbol = Symbol::intern("profiler_builtins");

0 commit comments

Comments
 (0)