[llvm] [Coverage] Rework Decision/Expansion/Branch (PR #78969)
Jessica Paquette via llvm-commits
llvm-commits at lists.llvm.org
Tue Jan 23 17:52:04 PST 2024
================
@@ -638,18 +720,12 @@ Error CoverageMapping::loadFunctionRecord(
Record.MappingRegions[0].Count.isZero() && Counts[0] > 0)
return Error::success();
- unsigned NumConds = 0;
- const CounterMappingRegion *MCDCDecision;
- std::vector<const CounterMappingRegion *> MCDCBranches;
-
+ SmallVector<DecisionRow> Decisions;
FunctionRecord Function(OrigFuncName, Record.Filenames);
for (const auto &Region : Record.MappingRegions) {
- // If an MCDCDecisionRegion is seen, track the BranchRegions that follow
- // it according to Region.NumConditions.
if (Region.Kind == CounterMappingRegion::MCDCDecisionRegion) {
- assert(NumConds == 0);
- MCDCDecision = &Region;
- NumConds = Region.MCDCParams.NumConditions;
+ // Start recording `Region` as the `Decision`
+ Decisions.emplace_back(Region);
----------------
ornata wrote:
why `emplace_back` instead of `push_back`?
https://github.com/llvm/llvm-project/pull/78969
More information about the llvm-commits
mailing list