@@ -9,8 +9,6 @@ use crate::ty::query::Query;
9
9
use crate :: ty:: query:: config:: { QueryConfig , QueryDescription } ;
10
10
use crate :: ty:: query:: job:: { QueryJob , QueryResult , QueryInfo } ;
11
11
12
- use crate :: util:: common:: { profq_msg, ProfileQueriesMsg , QueryMsg } ;
13
-
14
12
use errors:: DiagnosticBuilder ;
15
13
use errors:: Level ;
16
14
use errors:: Diagnostic ;
@@ -62,33 +60,6 @@ impl<'tcx, M: QueryConfig<'tcx>> Default for QueryCache<'tcx, M> {
62
60
}
63
61
}
64
62
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
-
92
63
/// A type representing the responsibility to execute the job in the `job` field.
93
64
/// This will poison the relevant query if dropped.
94
65
pub ( super ) struct JobOwner < ' a , ' tcx , Q : QueryDescription < ' tcx > > {
@@ -111,7 +82,6 @@ impl<'a, 'tcx, Q: QueryDescription<'tcx>> JobOwner<'a, 'tcx, Q> {
111
82
loop {
112
83
let mut lock = cache. get_shard_by_value ( key) . lock ( ) ;
113
84
if let Some ( value) = lock. results . get ( key) {
114
- profq_msg ! ( tcx, ProfileQueriesMsg :: CacheHit ) ;
115
85
tcx. prof . query_cache_hit ( Q :: NAME ) ;
116
86
let result = ( value. value . clone ( ) , value. index ) ;
117
87
#[ cfg( debug_assertions) ]
@@ -358,13 +328,6 @@ impl<'tcx> TyCtxt<'tcx> {
358
328
key,
359
329
span) ;
360
330
361
- profq_msg ! ( self ,
362
- ProfileQueriesMsg :: QueryBegin (
363
- span. data( ) ,
364
- profq_query_msg!( Q :: NAME . as_str( ) , self , key) ,
365
- )
366
- ) ;
367
-
368
331
let job = match JobOwner :: try_get ( self , span, & key) {
369
332
TryGetJob :: NotYetStarted ( job) => job,
370
333
TryGetJob :: Cycle ( result) => return result,
@@ -383,7 +346,6 @@ impl<'tcx> TyCtxt<'tcx> {
383
346
384
347
if Q :: ANON {
385
348
386
- profq_msg ! ( self , ProfileQueriesMsg :: ProviderBegin ) ;
387
349
let prof_timer = self . prof . query_provider ( Q :: NAME ) ;
388
350
389
351
let ( ( result, dep_node_index) , diagnostics) = with_diagnostics ( |diagnostics| {
@@ -395,7 +357,6 @@ impl<'tcx> TyCtxt<'tcx> {
395
357
} ) ;
396
358
397
359
drop ( prof_timer) ;
398
- profq_msg ! ( self , ProfileQueriesMsg :: ProviderEnd ) ;
399
360
400
361
self . dep_graph . read_index ( dep_node_index) ;
401
362
@@ -468,7 +429,6 @@ impl<'tcx> TyCtxt<'tcx> {
468
429
} ;
469
430
470
431
let result = if let Some ( result) = result {
471
- profq_msg ! ( self , ProfileQueriesMsg :: CacheHit ) ;
472
432
result
473
433
} else {
474
434
// We could not load a result from the on-disk cache, so
@@ -546,7 +506,6 @@ impl<'tcx> TyCtxt<'tcx> {
546
506
- dep-node: {:?}",
547
507
key, dep_node) ;
548
508
549
- profq_msg ! ( self , ProfileQueriesMsg :: ProviderBegin ) ;
550
509
let prof_timer = self . prof . query_provider ( Q :: NAME ) ;
551
510
552
511
let ( ( result, dep_node_index) , diagnostics) = with_diagnostics ( |diagnostics| {
@@ -568,7 +527,6 @@ impl<'tcx> TyCtxt<'tcx> {
568
527
} ) ;
569
528
570
529
drop ( prof_timer) ;
571
- profq_msg ! ( self , ProfileQueriesMsg :: ProviderEnd ) ;
572
530
573
531
if unlikely ! ( self . sess. opts. debugging_opts. query_dep_graph) {
574
532
self . dep_graph . mark_loaded_from_cache ( dep_node_index, false ) ;
@@ -614,19 +572,12 @@ impl<'tcx> TyCtxt<'tcx> {
614
572
615
573
let _ = self . get_query :: < Q > ( DUMMY_SP , key) ;
616
574
} else {
617
- profq_msg ! ( self , ProfileQueriesMsg :: CacheHit ) ;
618
575
self . prof . query_cache_hit ( Q :: NAME ) ;
619
576
}
620
577
}
621
578
622
579
#[ allow( dead_code) ]
623
580
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
-
630
581
// We may be concurrently trying both execute and force a query.
631
582
// Ensure that only one of them runs the query.
632
583
let job = match JobOwner :: try_get ( self , span, & key) {
0 commit comments