File tree Expand file tree Collapse file tree 4 files changed +13
-2
lines changed Expand file tree Collapse file tree 4 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -1099,7 +1099,6 @@ fn build_session_(
10991099 ) ;
11001100 match profiler {
11011101 Ok ( profiler) => {
1102- crate :: ty:: query:: QueryName :: register_with_profiler ( & profiler) ;
11031102 Some ( Arc :: new ( profiler) )
11041103 } ,
11051104 Err ( e) => {
Original file line number Diff line number Diff line change @@ -827,7 +827,9 @@ macro_rules! define_queries_inner {
827827 }
828828
829829 impl QueryName {
830- pub fn register_with_profiler( profiler: & rustc_data_structures:: profiling:: SelfProfiler ) {
830+ pub fn register_with_profiler(
831+ profiler: & rustc_data_structures:: profiling:: SelfProfiler ,
832+ ) {
831833 $( profiler. register_query_name( QueryName :: $name) ; ) *
832834 }
833835
Original file line number Diff line number Diff line change @@ -205,6 +205,12 @@ impl SelfProfilerRef {
205205 TimingGuard :: none ( )
206206 } ) ) ;
207207 }
208+
209+ pub fn register_queries ( & self , f : impl FnOnce ( & SelfProfiler ) ) {
210+ if let Some ( profiler) = & self . profiler {
211+ f ( & profiler)
212+ }
213+ }
208214}
209215
210216pub struct SelfProfiler {
Original file line number Diff line number Diff line change @@ -108,6 +108,10 @@ pub fn create_session(
108108 process_configure_mod,
109109 ) ;
110110
111+ sess. prof . register_queries ( |profiler| {
112+ rustc:: ty:: query:: QueryName :: register_with_profiler ( & profiler) ;
113+ } ) ;
114+
111115 let codegen_backend = get_codegen_backend ( & sess) ;
112116
113117 let mut cfg = config:: build_configuration ( & sess, config:: to_crate_config ( cfg) ) ;
You can’t perform that action at this time.
0 commit comments