diff options
Diffstat (limited to 'tools/llvm-cov/SourceCoverageView.h')
| -rw-r--r-- | tools/llvm-cov/SourceCoverageView.h | 7 | 
1 files changed, 3 insertions, 4 deletions
diff --git a/tools/llvm-cov/SourceCoverageView.h b/tools/llvm-cov/SourceCoverageView.h index d92a7486d9d34..9e6fe5f350012 100644 --- a/tools/llvm-cov/SourceCoverageView.h +++ b/tools/llvm-cov/SourceCoverageView.h @@ -90,15 +90,14 @@ private:      bool hasMultipleRegions() const { return RegionCount > 1; }      void addRegionStartCount(uint64_t Count) { -      Mapped = true; -      ExecutionCount = Count; +      // The max of all region starts is the most interesting value. +      addRegionCount(RegionCount ? std::max(ExecutionCount, Count) : Count);        ++RegionCount;      }      void addRegionCount(uint64_t Count) {        Mapped = true; -      if (!RegionCount) -        ExecutionCount = Count; +      ExecutionCount = Count;      }    };  | 
