blob: abeca192e646ccc17675788b83c842b3a483beaa [file] [log] [blame]
Alex Lorenze82d89c2014-08-22 22:56:03 +00001//===- 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
Alex Lorenze82d89c2014-08-22 22:56:03 +000017#include "llvm/ProfileData/CoverageMapping.h"
Alex Lorenze82d89c2014-08-22 22:56:03 +000018#include <vector>
Alex Lorenze82d89c2014-08-22 22:56:03 +000019
20namespace llvm {
21
22/// \brief Partions mapping regions by their kind and sums
23/// the execution counts of the regions that start at the same location.
24class SourceCoverageDataManager {
Justin Bognere53be062014-09-09 05:32:18 +000025 std::vector<coverage::CountedRegion> Regions;
Alex Lorenze82d89c2014-08-22 22:56:03 +000026 bool Uniqued;
27
28public:
29 SourceCoverageDataManager() : Uniqued(false) {}
30
Justin Bogner8e8aa3f2014-09-09 05:32:14 +000031 void insert(const coverage::CountedRegion &CR);
Alex Lorenze82d89c2014-08-22 22:56:03 +000032
Justin Bognere53be062014-09-09 05:32:18 +000033 /// \brief Return the source regions in order of first to last occurring.
34 ArrayRef<coverage::CountedRegion> getSourceRegions();
Alex Lorenze82d89c2014-08-22 22:56:03 +000035};
36
37} // namespace llvm
38
39#endif // LLVM_COV_SOURCECOVERAGEDATAMANAGER_H