@@ -9,8 +9,6 @@ use crate::ty::query::Query;
99use crate :: ty:: query:: config:: { QueryConfig , QueryDescription } ;
1010use crate :: ty:: query:: job:: { QueryJob , QueryResult , QueryInfo } ;
1111
12- use crate :: util:: common:: { profq_msg, ProfileQueriesMsg , QueryMsg } ;
13-
1412use errors:: DiagnosticBuilder ;
1513use errors:: Level ;
1614use errors:: Diagnostic ;
@@ -62,33 +60,6 @@ impl<'tcx, M: QueryConfig<'tcx>> Default for QueryCache<'tcx, M> {
6260 }
6361}
6462
65- // If enabled, sends a message to the profile-queries thread.
66- macro_rules! profq_msg {
67- ( $tcx: expr, $msg: expr) => {
68- if cfg!( debug_assertions) {
69- if $tcx. sess. profile_queries( ) {
70- profq_msg( $tcx. sess, $msg)
71- }
72- }
73- }
74- }
75-
76- // If enabled, formats a key using its debug string, which can be
77- // expensive to compute (in terms of time).
78- macro_rules! profq_query_msg {
79- ( $query: expr, $tcx: expr, $key: expr) => { {
80- let msg = if cfg!( debug_assertions) {
81- if $tcx. sess. profile_queries_and_keys( ) {
82- Some ( format!( "{:?}" , $key) )
83- } else { None }
84- } else { None } ;
85- QueryMsg {
86- query: $query,
87- msg,
88- }
89- } }
90- }
91-
9263/// A type representing the responsibility to execute the job in the `job` field.
9364/// This will poison the relevant query if dropped.
9465pub ( super ) struct JobOwner < ' a , ' tcx , Q : QueryDescription < ' tcx > > {
@@ -111,7 +82,6 @@ impl<'a, 'tcx, Q: QueryDescription<'tcx>> JobOwner<'a, 'tcx, Q> {
11182 loop {
11283 let mut lock = cache. get_shard_by_value ( key) . lock ( ) ;
11384 if let Some ( value) = lock. results . get ( key) {
114- profq_msg ! ( tcx, ProfileQueriesMsg :: CacheHit ) ;
11585 tcx. prof . query_cache_hit ( Q :: NAME ) ;
11686 let result = ( value. value . clone ( ) , value. index ) ;
11787 #[ cfg( debug_assertions) ]
@@ -358,13 +328,6 @@ impl<'tcx> TyCtxt<'tcx> {
358328 key,
359329 span) ;
360330
361- profq_msg ! ( self ,
362- ProfileQueriesMsg :: QueryBegin (
363- span. data( ) ,
364- profq_query_msg!( Q :: NAME . as_str( ) , self , key) ,
365- )
366- ) ;
367-
368331 let job = match JobOwner :: try_get ( self , span, & key) {
369332 TryGetJob :: NotYetStarted ( job) => job,
370333 TryGetJob :: Cycle ( result) => return result,
@@ -383,7 +346,6 @@ impl<'tcx> TyCtxt<'tcx> {
383346
384347 if Q :: ANON {
385348
386- profq_msg ! ( self , ProfileQueriesMsg :: ProviderBegin ) ;
387349 let prof_timer = self . prof . query_provider ( Q :: NAME ) ;
388350
389351 let ( ( result, dep_node_index) , diagnostics) = with_diagnostics ( |diagnostics| {
@@ -395,7 +357,6 @@ impl<'tcx> TyCtxt<'tcx> {
395357 } ) ;
396358
397359 drop ( prof_timer) ;
398- profq_msg ! ( self , ProfileQueriesMsg :: ProviderEnd ) ;
399360
400361 self . dep_graph . read_index ( dep_node_index) ;
401362
@@ -468,7 +429,6 @@ impl<'tcx> TyCtxt<'tcx> {
468429 } ;
469430
470431 let result = if let Some ( result) = result {
471- profq_msg ! ( self , ProfileQueriesMsg :: CacheHit ) ;
472432 result
473433 } else {
474434 // We could not load a result from the on-disk cache, so
@@ -546,7 +506,6 @@ impl<'tcx> TyCtxt<'tcx> {
546506 - dep-node: {:?}",
547507 key, dep_node) ;
548508
549- profq_msg ! ( self , ProfileQueriesMsg :: ProviderBegin ) ;
550509 let prof_timer = self . prof . query_provider ( Q :: NAME ) ;
551510
552511 let ( ( result, dep_node_index) , diagnostics) = with_diagnostics ( |diagnostics| {
@@ -568,7 +527,6 @@ impl<'tcx> TyCtxt<'tcx> {
568527 } ) ;
569528
570529 drop ( prof_timer) ;
571- profq_msg ! ( self , ProfileQueriesMsg :: ProviderEnd ) ;
572530
573531 if unlikely ! ( self . sess. opts. debugging_opts. query_dep_graph) {
574532 self . dep_graph . mark_loaded_from_cache ( dep_node_index, false ) ;
@@ -614,19 +572,12 @@ impl<'tcx> TyCtxt<'tcx> {
614572
615573 let _ = self . get_query :: < Q > ( DUMMY_SP , key) ;
616574 } else {
617- profq_msg ! ( self , ProfileQueriesMsg :: CacheHit ) ;
618575 self . prof . query_cache_hit ( Q :: NAME ) ;
619576 }
620577 }
621578
622579 #[ allow( dead_code) ]
623580 fn force_query < Q : QueryDescription < ' tcx > > ( self , key : Q :: Key , span : Span , dep_node : DepNode ) {
624- profq_msg ! (
625- self ,
626- ProfileQueriesMsg :: QueryBegin ( span. data( ) ,
627- profq_query_msg!( Q :: NAME . as_str( ) , self , key) )
628- ) ;
629-
630581 // We may be concurrently trying both execute and force a query.
631582 // Ensure that only one of them runs the query.
632583 let job = match JobOwner :: try_get ( self , span, & key) {
0 commit comments