@@ -364,19 +364,16 @@ struct CountedRegion : public CounterMappingRegion {
364
364
uint64_t FalseExecutionCount;
365
365
bool TrueFolded;
366
366
bool FalseFolded;
367
- bool HasSingleByteCoverage;
368
367
369
- CountedRegion (const CounterMappingRegion &R, uint64_t ExecutionCount,
370
- bool HasSingleByteCoverage)
368
+ CountedRegion (const CounterMappingRegion &R, uint64_t ExecutionCount)
371
369
: CounterMappingRegion(R), ExecutionCount(ExecutionCount),
372
- FalseExecutionCount (0 ), TrueFolded(false ), FalseFolded(true ),
373
- HasSingleByteCoverage(HasSingleByteCoverage) {}
370
+ FalseExecutionCount (0 ), TrueFolded(false ), FalseFolded(true ) {}
374
371
375
372
CountedRegion (const CounterMappingRegion &R, uint64_t ExecutionCount,
376
- uint64_t FalseExecutionCount, bool HasSingleByteCoverage )
373
+ uint64_t FalseExecutionCount)
377
374
: CounterMappingRegion(R), ExecutionCount(ExecutionCount),
378
375
FalseExecutionCount(FalseExecutionCount), TrueFolded(false ),
379
- FalseFolded(false ), HasSingleByteCoverage(HasSingleByteCoverage) {}
376
+ FalseFolded(false ) {}
380
377
};
381
378
382
379
// / MCDC Record grouping all information together.
@@ -719,10 +716,9 @@ struct FunctionRecord {
719
716
}
720
717
721
718
void pushRegion (CounterMappingRegion Region, uint64_t Count,
722
- uint64_t FalseCount, bool HasSingleByteCoverage ) {
719
+ uint64_t FalseCount) {
723
720
if (Region.isBranch ()) {
724
- CountedBranchRegions.emplace_back (Region, Count, FalseCount,
725
- HasSingleByteCoverage);
721
+ CountedBranchRegions.emplace_back (Region, Count, FalseCount);
726
722
// If either counter is hard-coded to zero, then this region represents a
727
723
// constant-folded branch.
728
724
CountedBranchRegions.back ().TrueFolded = Region.Count .isZero ();
@@ -731,8 +727,7 @@ struct FunctionRecord {
731
727
}
732
728
if (CountedRegions.empty ())
733
729
ExecutionCount = Count;
734
- CountedRegions.emplace_back (Region, Count, FalseCount,
735
- HasSingleByteCoverage);
730
+ CountedRegions.emplace_back (Region, Count, FalseCount);
736
731
}
737
732
};
738
733
@@ -895,14 +890,19 @@ class CoverageData {
895
890
std::vector<CountedRegion> BranchRegions;
896
891
std::vector<MCDCRecord> MCDCRecords;
897
892
893
+ bool SingleByteCoverage;
894
+
898
895
public:
899
- CoverageData () = default ;
896
+ CoverageData () = delete ;
900
897
901
- CoverageData (StringRef Filename) : Filename(Filename) {}
898
+ CoverageData (bool Single, StringRef Filename = StringRef())
899
+ : Filename(Filename), SingleByteCoverage(Single) {}
902
900
903
901
// / Get the name of the file this data covers.
904
902
StringRef getFilename () const { return Filename; }
905
903
904
+ bool getSingleByteCoverage () const { return SingleByteCoverage; }
905
+
906
906
// / Get an iterator over the coverage segments for this object. The segments
907
907
// / are guaranteed to be uniqued and sorted by location.
908
908
std::vector<CoverageSegment>::const_iterator begin () const {
@@ -935,7 +935,9 @@ class CoverageMapping {
935
935
DenseMap<size_t , SmallVector<unsigned , 0 >> FilenameHash2RecordIndices;
936
936
std::vector<std::pair<std::string, uint64_t >> FuncHashMismatches;
937
937
938
- CoverageMapping () = default ;
938
+ bool SingleByteCoverage;
939
+
940
+ CoverageMapping (bool Single) : SingleByteCoverage(Single) {}
939
941
940
942
// Load coverage records from readers.
941
943
static Error loadFromReaders (
@@ -979,6 +981,8 @@ class CoverageMapping {
979
981
const object::BuildIDFetcher *BIDFetcher = nullptr ,
980
982
bool CheckBinaryIDs = false );
981
983
984
+ bool getSingleByteCoverage () const { return SingleByteCoverage; }
985
+
982
986
// / The number of functions that couldn't have their profiles mapped.
983
987
// /
984
988
// / This is a count of functions whose profile is out of date or otherwise
0 commit comments