llvm-cov: Combine two types that were nearly identical (NFC)
[oota-llvm.git] / tools / llvm-cov / SourceCoverageDataManager.h
1 //===- SourceCoverageDataManager.h - Manager for source file coverage data-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This class separates and merges mapping regions for a specific source file.
11 //
12 //===----------------------------------------------------------------------===//
13
14 #ifndef LLVM_COV_SOURCECOVERAGEDATAMANAGER_H
15 #define LLVM_COV_SOURCECOVERAGEDATAMANAGER_H
16
17 #include "FunctionCoverageMapping.h"
18 #include "llvm/ProfileData/CoverageMapping.h"
19 #include <vector>
20
21 namespace llvm {
22
23 /// \brief Partions mapping regions by their kind and sums
24 /// the execution counts of the regions that start at the same location.
25 class SourceCoverageDataManager {
26   std::vector<coverage::CountedRegion> Regions;
27   bool Uniqued;
28
29 public:
30   SourceCoverageDataManager() : Uniqued(false) {}
31
32   void insert(const coverage::CountedRegion &CR);
33
34   /// \brief Return the source regions in order of first to last occurring.
35   ArrayRef<coverage::CountedRegion> getSourceRegions();
36 };
37
38 } // namespace llvm
39
40 #endif // LLVM_COV_SOURCECOVERAGEDATAMANAGER_H