@@ -392,8 +392,9 @@ class MCDCRecordProcessor : NextIDsBuilder, mcdc::TVIdxBuilder {
392392 : NextIDsBuilder(Branches), TVIdxBuilder(this ->NextIDs), Bitmap(Bitmap),
393393 Region (Region), DecisionParams(Region.getDecisionParams()),
394394 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) {}
397398
398399private:
399400 // Walk the binary decision diagram and try assigning both false and true to
@@ -485,7 +486,6 @@ class MCDCRecordProcessor : NextIDsBuilder, mcdc::TVIdxBuilder {
485486 // / location is also tracked, as well as whether it is constant folded (in
486487 // / which case it is excuded from the metric).
487488 MCDCRecord processMCDCRecord () {
488- unsigned I = 0 ;
489489 MCDCRecord::CondIDMap PosToID;
490490 MCDCRecord::LineColPairMap CondLoc;
491491
@@ -499,11 +499,12 @@ class MCDCRecordProcessor : NextIDsBuilder, mcdc::TVIdxBuilder {
499499 // visualize where the condition is.
500500 // - Record whether the condition is constant folded so that we exclude it
501501 // from being measured.
502- for (const auto *B : Branches) {
502+ for (auto [I, B] : enumerate( Branches) ) {
503503 const auto &BranchParams = B->getBranchParams ();
504504 PosToID[I] = BranchParams.ID ;
505505 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 ();
507508 }
508509
509510 // Using Profile Bitmap from runtime, mark the executed test vectors.
0 commit comments