@@ -8,15 +8,14 @@ use rustc_abi::{FieldIdx, VariantIdx};
88use rustc_data_structures:: fx:: FxIndexMap ;
99use rustc_errors:: ErrorGuaranteed ;
1010use rustc_hir:: def_id:: LocalDefId ;
11- use rustc_index:: bit_set:: { BitMatrix , BitSet } ;
11+ use rustc_index:: bit_set:: BitMatrix ;
1212use rustc_index:: { Idx , IndexVec } ;
1313use rustc_macros:: { HashStable , TyDecodable , TyEncodable , TypeFoldable , TypeVisitable } ;
1414use rustc_span:: Span ;
1515use rustc_span:: symbol:: Symbol ;
1616use smallvec:: SmallVec ;
1717
1818use super :: { ConstValue , SourceInfo } ;
19- use crate :: mir;
2019use crate :: ty:: fold:: fold_regions;
2120use crate :: ty:: { self , CoroutineArgsExt , OpaqueHiddenType , Ty , TyCtxt } ;
2221
@@ -351,30 +350,3 @@ pub struct DestructuredConstant<'tcx> {
351350 pub variant : Option < VariantIdx > ,
352351 pub fields : & ' tcx [ ( ConstValue < ' tcx > , Ty < ' tcx > ) ] ,
353352}
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