@@ -392,8 +392,9 @@ class MCDCRecordProcessor : NextIDsBuilder, mcdc::TVIdxBuilder {
392
392
: NextIDsBuilder(Branches), TVIdxBuilder(this ->NextIDs), Bitmap(Bitmap),
393
393
Region (Region), DecisionParams(Region.getDecisionParams()),
394
394
Branches(Branches), NumConditions(DecisionParams.NumConditions),
395
- Folded(NumConditions, false ), IndependencePairs(NumConditions),
396
- ExecVectors(ExecVectorsByCond[false ]), IsVersion11(IsVersion11) {}
395
+ Folded{{BitVector (NumConditions), BitVector (NumConditions)}},
396
+ IndependencePairs (NumConditions), ExecVectors(ExecVectorsByCond[false ]),
397
+ IsVersion11(IsVersion11) {}
397
398
398
399
private:
399
400
// Walk the binary decision diagram and try assigning both false and true to
@@ -485,7 +486,6 @@ class MCDCRecordProcessor : NextIDsBuilder, mcdc::TVIdxBuilder {
485
486
// / location is also tracked, as well as whether it is constant folded (in
486
487
// / which case it is excuded from the metric).
487
488
MCDCRecord processMCDCRecord () {
488
- unsigned I = 0 ;
489
489
MCDCRecord::CondIDMap PosToID;
490
490
MCDCRecord::LineColPairMap CondLoc;
491
491
@@ -499,11 +499,12 @@ class MCDCRecordProcessor : NextIDsBuilder, mcdc::TVIdxBuilder {
499
499
// visualize where the condition is.
500
500
// - Record whether the condition is constant folded so that we exclude it
501
501
// from being measured.
502
- for (const auto *B : Branches) {
502
+ for (auto [I, B] : enumerate( Branches) ) {
503
503
const auto &BranchParams = B->getBranchParams ();
504
504
PosToID[I] = BranchParams.ID ;
505
505
CondLoc[I] = B->startLoc ();
506
- Folded[I++] = (B->Count .isZero () || B->FalseCount .isZero ());
506
+ Folded[false ][I] = B->FalseCount .isZero ();
507
+ Folded[true ][I] = B->Count .isZero ();
507
508
}
508
509
509
510
// Using Profile Bitmap from runtime, mark the executed test vectors.
0 commit comments