Skip to content

Commit

Permalink
Disable the self-profiler unless the -Z self-profile flag is set
Browse files Browse the repository at this point in the history
Related to #51648
  • Loading branch information
wesleywiser committed Nov 22, 2018
1 parent dae6c93 commit b319715
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/librustc/session/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -826,8 +826,10 @@ impl Session {
}

pub fn profiler<F: FnOnce(&mut SelfProfiler) -> ()>(&self, f: F) {
let mut profiler = self.self_profiling.borrow_mut();
f(&mut profiler);
if self.opts.debugging_opts.self_profile {
let mut profiler = self.self_profiling.borrow_mut();
f(&mut profiler);
}
}

pub fn print_profiler_results(&self) {
Expand Down

0 comments on commit b319715

Please sign in to comment.