From 2fd545485aea36d0dcb403375218fd801f4a2ca8 Mon Sep 17 00:00:00 2001 From: Mark Rousskov Date: Tue, 12 Nov 2019 11:44:01 -0500 Subject: Register queries with self profiler in rustc_interface --- src/librustc_data_structures/profiling.rs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/librustc_data_structures') diff --git a/src/librustc_data_structures/profiling.rs b/src/librustc_data_structures/profiling.rs index b89170cccdb..86f59bfabe6 100644 --- a/src/librustc_data_structures/profiling.rs +++ b/src/librustc_data_structures/profiling.rs @@ -205,6 +205,12 @@ impl SelfProfilerRef { TimingGuard::none() })); } + + pub fn register_queries(&self, f: impl FnOnce(&SelfProfiler)) { + if let Some(profiler) = &self.profiler { + f(&profiler) + } + } } pub struct SelfProfiler { -- cgit 1.4.1-3-g733a5