Skip to content
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions llvm/lib/ProfileData/Coverage/CoverageMapping.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -808,6 +808,7 @@ Error CoverageMapping::loadFunctionRecord(
else
OrigFuncName = getFuncNameWithoutPrefix(OrigFuncName, Record.Filenames[0]);

bool SingleByteCoverage = ProfileReader.hasSingleByteCoverage();
CounterMappingContext Ctx(Record.Expressions);

std::vector<uint64_t> Counts;
Expand Down Expand Up @@ -873,8 +874,10 @@ Error CoverageMapping::loadFunctionRecord(
consumeError(std::move(E));
return Error::success();
}
Function.pushRegion(Region, *ExecutionCount, *AltExecutionCount,
ProfileReader.hasSingleByteCoverage());
Function.pushRegion(
Region, (SingleByteCoverage && *ExecutionCount ? 1 : *ExecutionCount),
(SingleByteCoverage && *AltExecutionCount ? 1 : *AltExecutionCount),
SingleByteCoverage);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The last arg will be pruned after #110966.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll rewind this entirely with #110966 to make the viewer responsible to round counters.


// Record ExpansionRegion.
if (Region.Kind == CounterMappingRegion::ExpansionRegion) {
Expand Down