Disable the self-profiler unless the -Z self-profile flag is set

Related to #51648
This commit is contained in:
Wesley Wiser 2018-11-22 12:56:15 -05:00
parent dae6c93641
commit b319715456

View file

@ -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) {