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_(
1099
1099
) ;
1100
1100
match profiler {
1101
1101
Ok ( profiler) => {
1102
- crate :: ty:: query:: QueryName :: register_with_profiler ( & profiler) ;
1103
1102
Some ( Arc :: new ( profiler) )
1104
1103
} ,
1105
1104
Err ( e) => {
Original file line number Diff line number Diff line change @@ -827,7 +827,9 @@ macro_rules! define_queries_inner {
827
827
}
828
828
829
829
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
+ ) {
831
833
$( profiler. register_query_name( QueryName :: $name) ; ) *
832
834
}
833
835
Original file line number Diff line number Diff line change @@ -205,6 +205,12 @@ impl SelfProfilerRef {
205
205
TimingGuard :: none ( )
206
206
} ) ) ;
207
207
}
208
+
209
+ pub fn register_queries ( & self , f : impl FnOnce ( & SelfProfiler ) ) {
210
+ if let Some ( profiler) = & self . profiler {
211
+ f ( & profiler)
212
+ }
213
+ }
208
214
}
209
215
210
216
pub struct SelfProfiler {
Original file line number Diff line number Diff line change @@ -108,6 +108,10 @@ pub fn create_session(
108
108
process_configure_mod,
109
109
) ;
110
110
111
+ sess. prof . register_queries ( |profiler| {
112
+ rustc:: ty:: query:: QueryName :: register_with_profiler ( & profiler) ;
113
+ } ) ;
114
+
111
115
let codegen_backend = get_codegen_backend ( & sess) ;
112
116
113
117
let mut cfg = config:: build_configuration ( & sess, config:: to_crate_config ( cfg) ) ;
You can’t perform that action at this time.
0 commit comments