diff options
author | NAKAMURA Takumi <geek4civic@gmail.com> | 2024-12-28 17:48:30 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-12-28 17:48:30 +0900 |
commit | ee6f10d37232627137ce97388a5eb21b90907bfb (patch) | |
tree | e9b5a63df99ad3045ee2dd50fbb01957699dbbe9 /llvm/lib/ProfileData/Coverage/CoverageMapping.cpp | |
parent | 811e1f4661bca4a2b5c93d30f54c3aa338f175e9 (diff) | |
download | llvm-ee6f10d37232627137ce97388a5eb21b90907bfb.zip llvm-ee6f10d37232627137ce97388a5eb21b90907bfb.tar.gz llvm-ee6f10d37232627137ce97388a5eb21b90907bfb.tar.bz2 |
[Coverage] Make `MCDCRecord::Folded` as `[false/true]` with BitVector. NFC. (#121190)
For merging `MCDCRecord`s, `Folded` is expected to be promoted as
"Non-folded".
Diffstat (limited to 'llvm/lib/ProfileData/Coverage/CoverageMapping.cpp')
-rw-r--r-- | llvm/lib/ProfileData/Coverage/CoverageMapping.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/llvm/lib/ProfileData/Coverage/CoverageMapping.cpp b/llvm/lib/ProfileData/Coverage/CoverageMapping.cpp index 1bf2e8d..f95e311 100644 --- a/llvm/lib/ProfileData/Coverage/CoverageMapping.cpp +++ b/llvm/lib/ProfileData/Coverage/CoverageMapping.cpp @@ -392,8 +392,9 @@ public: : NextIDsBuilder(Branches), TVIdxBuilder(this->NextIDs), Bitmap(Bitmap), Region(Region), DecisionParams(Region.getDecisionParams()), Branches(Branches), NumConditions(DecisionParams.NumConditions), - Folded(NumConditions, false), IndependencePairs(NumConditions), - ExecVectors(ExecVectorsByCond[false]), IsVersion11(IsVersion11) {} + Folded{{BitVector(NumConditions), BitVector(NumConditions)}}, + IndependencePairs(NumConditions), ExecVectors(ExecVectorsByCond[false]), + IsVersion11(IsVersion11) {} private: // Walk the binary decision diagram and try assigning both false and true to @@ -485,7 +486,6 @@ public: /// location is also tracked, as well as whether it is constant folded (in /// which case it is excuded from the metric). MCDCRecord processMCDCRecord() { - unsigned I = 0; MCDCRecord::CondIDMap PosToID; MCDCRecord::LineColPairMap CondLoc; @@ -499,11 +499,12 @@ public: // visualize where the condition is. // - Record whether the condition is constant folded so that we exclude it // from being measured. - for (const auto *B : Branches) { + for (auto [I, B] : enumerate(Branches)) { const auto &BranchParams = B->getBranchParams(); PosToID[I] = BranchParams.ID; CondLoc[I] = B->startLoc(); - Folded[I++] = (B->Count.isZero() || B->FalseCount.isZero()); + Folded[false][I] = B->FalseCount.isZero(); + Folded[true][I] = B->Count.isZero(); } // Using Profile Bitmap from runtime, mark the executed test vectors. |