@@ -8,15 +8,14 @@ use rustc_abi::{FieldIdx, VariantIdx};
8
8
use rustc_data_structures:: fx:: FxIndexMap ;
9
9
use rustc_errors:: ErrorGuaranteed ;
10
10
use rustc_hir:: def_id:: LocalDefId ;
11
- use rustc_index:: bit_set:: { BitMatrix , BitSet } ;
11
+ use rustc_index:: bit_set:: BitMatrix ;
12
12
use rustc_index:: { Idx , IndexVec } ;
13
13
use rustc_macros:: { HashStable , TyDecodable , TyEncodable , TypeFoldable , TypeVisitable } ;
14
14
use rustc_span:: Span ;
15
15
use rustc_span:: symbol:: Symbol ;
16
16
use smallvec:: SmallVec ;
17
17
18
18
use super :: { ConstValue , SourceInfo } ;
19
- use crate :: mir;
20
19
use crate :: ty:: fold:: fold_regions;
21
20
use crate :: ty:: { self , CoroutineArgsExt , OpaqueHiddenType , Ty , TyCtxt } ;
22
21
@@ -351,30 +350,3 @@ pub struct DestructuredConstant<'tcx> {
351
350
pub variant : Option < VariantIdx > ,
352
351
pub fields : & ' tcx [ ( ConstValue < ' tcx > , Ty < ' tcx > ) ] ,
353
352
}
354
-
355
- /// Summarizes coverage IDs inserted by the `InstrumentCoverage` MIR pass
356
- /// (for compiler option `-Cinstrument-coverage`), after MIR optimizations
357
- /// have had a chance to potentially remove some of them.
358
- ///
359
- /// Used by the `coverage_ids_info` query.
360
- #[ derive( Clone , TyEncodable , TyDecodable , Debug , HashStable ) ]
361
- pub struct CoverageIdsInfo {
362
- pub counters_seen : BitSet < mir:: coverage:: CounterId > ,
363
- pub expressions_seen : BitSet < mir:: coverage:: ExpressionId > ,
364
- }
365
-
366
- impl CoverageIdsInfo {
367
- /// Coverage codegen needs to know how many coverage counters are ever
368
- /// incremented within a function, so that it can set the `num-counters`
369
- /// argument of the `llvm.instrprof.increment` intrinsic.
370
- ///
371
- /// This may be less than the highest counter ID emitted by the
372
- /// InstrumentCoverage MIR pass, if the highest-numbered counter increments
373
- /// were removed by MIR optimizations.
374
- pub fn num_counters_after_mir_opts ( & self ) -> u32 {
375
- // FIXME(Zalathar): Currently this treats an unused counter as "used"
376
- // if its ID is less than that of the highest counter that really is
377
- // used. Fixing this would require adding a renumbering step somewhere.
378
- self . counters_seen . last_set_in ( ..) . map_or ( 0 , |max| max. as_u32 ( ) + 1 )
379
- }
380
- }
0 commit comments