@@ -70,7 +70,8 @@ pub(crate) fn dump_covfun_mappings(
70
70
}
71
71
// If the mapping is a branch region, print both of its arms
72
72
// in resolved form (even if they aren't expressions).
73
- MappingKind :: Branch { r#true, r#false } => {
73
+ MappingKind :: Branch { r#true, r#false }
74
+ | MappingKind :: MCDCBranch { r#true, r#false, .. } => {
74
75
println ! ( " true = {}" , expression_resolver. format_term( r#true) ) ;
75
76
println ! ( " false = {}" , expression_resolver. format_term( r#false) ) ;
76
77
}
@@ -164,6 +165,26 @@ impl<'a> Parser<'a> {
164
165
let r#false = self . read_simple_term ( ) ?;
165
166
Ok ( MappingKind :: Branch { r#true, r#false } )
166
167
}
168
+ 5 => {
169
+ let bitmap_idx = self . read_uleb128_u32 ( ) ?;
170
+ let conditions_num = self . read_uleb128_u32 ( ) ?;
171
+ Ok ( MappingKind :: MCDCDecision { bitmap_idx, conditions_num } )
172
+ }
173
+ 6 => {
174
+ let r#true = self . read_simple_term ( ) ?;
175
+ let r#false = self . read_simple_term ( ) ?;
176
+ let condition_id = self . read_uleb128_u32 ( ) ?;
177
+ let true_next_id = self . read_uleb128_u32 ( ) ?;
178
+ let false_next_id = self . read_uleb128_u32 ( ) ?;
179
+ Ok ( MappingKind :: MCDCBranch {
180
+ r#true,
181
+ r#false,
182
+ condition_id,
183
+ true_next_id,
184
+ false_next_id,
185
+ } )
186
+ }
187
+
167
188
_ => Err ( anyhow ! ( "unknown mapping kind: {raw_mapping_kind:#x}" ) ) ,
168
189
}
169
190
}
@@ -224,7 +245,28 @@ enum MappingKind {
224
245
// Using raw identifiers here makes the dump output a little bit nicer
225
246
// (via the derived Debug), at the expense of making this tool's source
226
247
// code a little bit uglier.
227
- Branch { r#true : CovTerm , r#false : CovTerm } ,
248
+ Branch {
249
+ r#true : CovTerm ,
250
+ r#false : CovTerm ,
251
+ } ,
252
+ MCDCBranch {
253
+ r#true : CovTerm ,
254
+ r#false : CovTerm ,
255
+ // These attributes are printed in Debug but not used directly.
256
+ #[ allow( dead_code) ]
257
+ condition_id : u32 ,
258
+ #[ allow( dead_code) ]
259
+ true_next_id : u32 ,
260
+ #[ allow( dead_code) ]
261
+ false_next_id : u32 ,
262
+ } ,
263
+ MCDCDecision {
264
+ // These attributes are printed in Debug but not used directly.
265
+ #[ allow( dead_code) ]
266
+ bitmap_idx : u32 ,
267
+ #[ allow( dead_code) ]
268
+ conditions_num : u32 ,
269
+ } ,
228
270
}
229
271
230
272
struct MappingRegion {
0 commit comments