about summary refs log tree commit diff
path: root/src/librustc_data_structures
diff options
context:
space:
mode:
authorMark Rousskov <mark.simulacrum@gmail.com>2019-11-12 11:44:01 -0500
committerMark Rousskov <mark.simulacrum@gmail.com>2019-11-12 13:13:14 -0500
commit2fd545485aea36d0dcb403375218fd801f4a2ca8 (patch)
tree855a5633b0897e14f8cc0e79d591ce3b1c15f6e0 /src/librustc_data_structures
parentf696b21c5f1017ebb451d1e9d2d8fe261b26507f (diff)
downloadrust-2fd545485aea36d0dcb403375218fd801f4a2ca8.tar.gz
rust-2fd545485aea36d0dcb403375218fd801f4a2ca8.zip
Register queries with self profiler in rustc_interface
Diffstat (limited to 'src/librustc_data_structures')
-rw-r--r--src/librustc_data_structures/profiling.rs6
1 files changed, 6 insertions, 0 deletions
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 {