File tree 1 file changed +15
-2
lines changed
1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -697,6 +697,16 @@ macro_rules! define_maps {
697
697
} ) *
698
698
}
699
699
700
+ // This module and the functions in it exist only to provide a
701
+ // predictable symbol name prefix for query providers. This is helpful
702
+ // for analyzing queries in profilers.
703
+ pub ( super ) mod __query_compute {
704
+ $( #[ inline( never) ]
705
+ pub fn $name<F : FnOnce ( ) -> R , R >( f: F ) -> R {
706
+ f( )
707
+ } ) *
708
+ }
709
+
700
710
$( impl <$tcx> QueryConfig <$tcx> for queries:: $name<$tcx> {
701
711
type Key = $K;
702
712
type Value = $V;
@@ -718,9 +728,12 @@ macro_rules! define_maps {
718
728
DepNode :: new( tcx, $node( * key) )
719
729
}
720
730
731
+ #[ inline]
721
732
fn compute( tcx: TyCtxt <' _, ' tcx, ' _>, key: Self :: Key ) -> Self :: Value {
722
- let provider = tcx. maps. providers[ key. map_crate( ) ] . $name;
723
- provider( tcx. global_tcx( ) , key)
733
+ __query_compute:: $name( move || {
734
+ let provider = tcx. maps. providers[ key. map_crate( ) ] . $name;
735
+ provider( tcx. global_tcx( ) , key)
736
+ } )
724
737
}
725
738
726
739
fn handle_cycle_error( tcx: TyCtxt <' _, ' tcx, ' _>) -> Self :: Value {
You can’t perform that action at this time.
0 commit comments