@@ -76,13 +76,19 @@ impl Debug for CovTerm {
76
76
77
77
#[ derive( Clone , PartialEq , TyEncodable , TyDecodable , Hash , HashStable , TypeFoldable , TypeVisitable ) ]
78
78
pub enum CoverageKind {
79
+ BlockMarker {
80
+ id : BlockMarkerId ,
81
+ } ,
82
+
79
83
/// Marks the point in MIR control flow represented by a coverage counter.
80
84
///
81
85
/// This is eventually lowered to `llvm.instrprof.increment` in LLVM IR.
82
86
///
83
87
/// If this statement does not survive MIR optimizations, any mappings that
84
88
/// refer to this counter can have those references simplified to zero.
85
- CounterIncrement { id : CounterId } ,
89
+ CounterIncrement {
90
+ id : CounterId ,
91
+ } ,
86
92
87
93
/// Marks the point in MIR control-flow represented by a coverage expression.
88
94
///
@@ -92,13 +98,16 @@ pub enum CoverageKind {
92
98
/// (This is only inserted for expression IDs that are directly used by
93
99
/// mappings. Intermediate expressions with no direct mappings are
94
100
/// retained/zeroed based on whether they are transitively used.)
95
- ExpressionUsed { id : ExpressionId } ,
101
+ ExpressionUsed {
102
+ id : ExpressionId ,
103
+ } ,
96
104
}
97
105
98
106
impl Debug for CoverageKind {
99
107
fn fmt ( & self , fmt : & mut Formatter < ' _ > ) -> fmt:: Result {
100
108
use CoverageKind :: * ;
101
109
match self {
110
+ BlockMarker { id } => write ! ( fmt, "BlockMarker({:?})" , id. index( ) ) ,
102
111
CounterIncrement { id } => write ! ( fmt, "CounterIncrement({:?})" , id. index( ) ) ,
103
112
ExpressionUsed { id } => write ! ( fmt, "ExpressionUsed({:?})" , id. index( ) ) ,
104
113
}
@@ -187,4 +196,22 @@ pub struct HirInfo {
187
196
pub function_source_hash : u64 ,
188
197
pub fn_sig_span : Span ,
189
198
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 ,
190
217
}
0 commit comments