@@ -370,16 +370,19 @@ struct CountedRegion : public CounterMappingRegion {
370370 uint64_t FalseExecutionCount;
371371 bool TrueFolded;
372372 bool FalseFolded;
373+ bool HasSingleByteCoverage;
373374
374- CountedRegion (const CounterMappingRegion &R, uint64_t ExecutionCount)
375+ CountedRegion (const CounterMappingRegion &R, uint64_t ExecutionCount,
376+ bool HasSingleByteCoverage)
375377 : CounterMappingRegion(R), ExecutionCount(ExecutionCount),
376- FalseExecutionCount (0 ), TrueFolded(false ), FalseFolded(true ) {}
378+ FalseExecutionCount (0 ), TrueFolded(false ), FalseFolded(true ),
379+ HasSingleByteCoverage(HasSingleByteCoverage) {}
377380
378381 CountedRegion (const CounterMappingRegion &R, uint64_t ExecutionCount,
379- uint64_t FalseExecutionCount)
382+ uint64_t FalseExecutionCount, bool HasSingleByteCoverage )
380383 : CounterMappingRegion(R), ExecutionCount(ExecutionCount),
381384 FalseExecutionCount(FalseExecutionCount), TrueFolded(false ),
382- FalseFolded(false ) {}
385+ FalseFolded(false ), HasSingleByteCoverage(HasSingleByteCoverage) {}
383386};
384387
385388// / MCDC Record grouping all information together.
@@ -722,9 +725,10 @@ struct FunctionRecord {
722725 }
723726
724727 void pushRegion (CounterMappingRegion Region, uint64_t Count,
725- uint64_t FalseCount) {
728+ uint64_t FalseCount, bool HasSingleByteCoverage ) {
726729 if (Region.isBranch ()) {
727- CountedBranchRegions.emplace_back (Region, Count, FalseCount);
730+ CountedBranchRegions.emplace_back (Region, Count, FalseCount,
731+ HasSingleByteCoverage);
728732 // If either counter is hard-coded to zero, then this region represents a
729733 // constant-folded branch.
730734 CountedBranchRegions.back ().TrueFolded = Region.Count .isZero ();
@@ -733,7 +737,8 @@ struct FunctionRecord {
733737 }
734738 if (CountedRegions.empty ())
735739 ExecutionCount = Count;
736- CountedRegions.emplace_back (Region, Count, FalseCount);
740+ CountedRegions.emplace_back (Region, Count, FalseCount,
741+ HasSingleByteCoverage);
737742 }
738743};
739744
@@ -896,19 +901,14 @@ class CoverageData {
896901 std::vector<CountedRegion> BranchRegions;
897902 std::vector<MCDCRecord> MCDCRecords;
898903
899- bool SingleByteCoverage;
900-
901904public:
902- CoverageData () = delete ;
905+ CoverageData () = default ;
903906
904- CoverageData (bool Single, StringRef Filename = StringRef())
905- : Filename(Filename), SingleByteCoverage(Single) {}
907+ CoverageData (StringRef Filename) : Filename(Filename) {}
906908
907909 // / Get the name of the file this data covers.
908910 StringRef getFilename () const { return Filename; }
909911
910- bool getSingleByteCoverage () const { return SingleByteCoverage; }
911-
912912 // / Get an iterator over the coverage segments for this object. The segments
913913 // / are guaranteed to be uniqued and sorted by location.
914914 std::vector<CoverageSegment>::const_iterator begin () const {
@@ -941,9 +941,7 @@ class CoverageMapping {
941941 DenseMap<size_t , SmallVector<unsigned , 0 >> FilenameHash2RecordIndices;
942942 std::vector<std::pair<std::string, uint64_t >> FuncHashMismatches;
943943
944- bool SingleByteCoverage;
945-
946- CoverageMapping (bool Single) : SingleByteCoverage(Single) {}
944+ CoverageMapping () = default ;
947945
948946 // Load coverage records from readers.
949947 static Error loadFromReaders (
@@ -987,8 +985,6 @@ class CoverageMapping {
987985 const object::BuildIDFetcher *BIDFetcher = nullptr ,
988986 bool CheckBinaryIDs = false );
989987
990- bool getSingleByteCoverage () const { return SingleByteCoverage; }
991-
992988 // / The number of functions that couldn't have their profiles mapped.
993989 // /
994990 // / This is a count of functions whose profile is out of date or otherwise
0 commit comments