@@ -76,13 +76,19 @@ impl Debug for CovTerm {
7676
7777#[ derive( Clone , PartialEq , TyEncodable , TyDecodable , Hash , HashStable , TypeFoldable , TypeVisitable ) ]
7878pub enum CoverageKind {
79+ BlockMarker {
80+ id : BlockMarkerId ,
81+ } ,
82+
7983 /// Marks the point in MIR control flow represented by a coverage counter.
8084 ///
8185 /// This is eventually lowered to `llvm.instrprof.increment` in LLVM IR.
8286 ///
8387 /// If this statement does not survive MIR optimizations, any mappings that
8488 /// refer to this counter can have those references simplified to zero.
85- CounterIncrement { id : CounterId } ,
89+ CounterIncrement {
90+ id : CounterId ,
91+ } ,
8692
8793 /// Marks the point in MIR control-flow represented by a coverage expression.
8894 ///
@@ -92,13 +98,16 @@ pub enum CoverageKind {
9298 /// (This is only inserted for expression IDs that are directly used by
9399 /// mappings. Intermediate expressions with no direct mappings are
94100 /// retained/zeroed based on whether they are transitively used.)
95- ExpressionUsed { id : ExpressionId } ,
101+ ExpressionUsed {
102+ id : ExpressionId ,
103+ } ,
96104}
97105
98106impl Debug for CoverageKind {
99107 fn fmt ( & self , fmt : & mut Formatter < ' _ > ) -> fmt:: Result {
100108 use CoverageKind :: * ;
101109 match self {
110+ BlockMarker { id } => write ! ( fmt, "BlockMarker({:?})" , id. index( ) ) ,
102111 CounterIncrement { id } => write ! ( fmt, "CounterIncrement({:?})" , id. index( ) ) ,
103112 ExpressionUsed { id } => write ! ( fmt, "ExpressionUsed({:?})" , id. index( ) ) ,
104113 }
@@ -187,4 +196,22 @@ pub struct HirInfo {
187196 pub function_source_hash : u64 ,
188197 pub fn_sig_span : Span ,
189198 pub body_span : Span ,
199+
200+ pub num_block_markers : usize ,
201+ pub branch_spans : Vec < BranchSpan > ,
202+ }
203+
204+ rustc_index:: newtype_index! {
205+ #[ derive( HashStable ) ]
206+ #[ encodable]
207+ #[ debug_format = "BlockMarkerId({})" ]
208+ pub struct BlockMarkerId { }
209+ }
210+
211+ #[ derive( Clone , Debug ) ]
212+ #[ derive( TyEncodable , TyDecodable , Hash , HashStable , TypeFoldable , TypeVisitable ) ]
213+ pub struct BranchSpan {
214+ pub span : Span ,
215+ pub true_marker : BlockMarkerId ,
216+ pub false_marker : BlockMarkerId ,
190217}
0 commit comments