1 //===- SourceCoverageDataManager.h - Manager for source file coverage data-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This class separates and merges mapping regions for a specific source file.
12 //===----------------------------------------------------------------------===//
14 #ifndef LLVM_COV_SOURCECOVERAGEDATAMANAGER_H
15 #define LLVM_COV_SOURCECOVERAGEDATAMANAGER_H
17 #include "llvm/ProfileData/CoverageMapping.h"
22 struct CoverageSegment {
29 CoverageSegment(unsigned Line, unsigned Col, bool IsRegionEntry)
30 : Line(Line), Col(Col), IsRegionEntry(IsRegionEntry),
31 Count(0), HasCount(false) {}
32 void setCount(uint64_t NewCount) {
38 /// \brief Partions mapping regions by their kind and sums
39 /// the execution counts of the regions that start at the same location.
40 class SourceCoverageDataManager {
41 std::vector<coverage::CountedRegion> Regions;
42 std::vector<CoverageSegment> Segments;
45 void insert(const coverage::CountedRegion &CR);
47 /// \brief Return a sequence of non-overlapping coverage segments.
48 ArrayRef<CoverageSegment> getCoverageSegments();
53 #endif // LLVM_COV_SOURCECOVERAGEDATAMANAGER_H