ErrorOr<int64_t> evaluate(const Counter &C) const;
};
+/// \brief Code coverage information for a single function.
+struct FunctionCoverageMapping {
+ /// \brief Raw function name.
+ std::string Name;
+ /// \brief Associated files.
+ std::vector<std::string> Filenames;
+ /// \brief Regions in the function along with their counts.
+ std::vector<CountedRegion> CountedRegions;
+
+ FunctionCoverageMapping(StringRef Name, ArrayRef<StringRef> Filenames)
+ : Name(Name), Filenames(Filenames.begin(), Filenames.end()) {}
+};
+
} // end namespace coverage
} // end namespace llvm
//
//===----------------------------------------------------------------------===//
-#include "FunctionCoverageMapping.h"
#include "RenderingSupport.h"
#include "CoverageViewOptions.h"
#include "CoverageFilters.h"
#ifndef LLVM_COV_COVERAGEFILTERS_H
#define LLVM_COV_COVERAGEFILTERS_H
-#include "FunctionCoverageMapping.h"
+#include "llvm/ProfileData/CoverageMapping.h"
#include <vector>
#include <memory>
namespace llvm {
+using coverage::FunctionCoverageMapping;
+
/// \brief Matches specific functions that pass the requirement of this filter.
class CoverageFilter {
public:
return Filenames.size() - 1;
}
-void
-CoverageSummary::createSummaries(ArrayRef<FunctionCoverageMapping> Functions) {
+void CoverageSummary::createSummaries(
+ ArrayRef<coverage::FunctionCoverageMapping> Functions) {
std::vector<std::pair<unsigned, size_t>> FunctionFileIDs;
FunctionFileIDs.resize(Functions.size());
unsigned getFileID(StringRef Filename);
public:
- void createSummaries(ArrayRef<FunctionCoverageMapping> Functions);
+ void createSummaries(ArrayRef<coverage::FunctionCoverageMapping> Functions);
ArrayRef<FileCoverageSummary> getFileSummaries() { return FileSummaries; }
#ifndef LLVM_COV_COVERAGESUMMARYINFO_H
#define LLVM_COV_COVERAGESUMMARYINFO_H
-#include "FunctionCoverageMapping.h"
+#include "llvm/ProfileData/CoverageMapping.h"
#include "llvm/Support/raw_ostream.h"
namespace llvm {
/// \brief Compute the code coverage summary for the given function coverage
/// mapping record.
- static FunctionCoverageSummary get(const FunctionCoverageMapping &Function);
+ static FunctionCoverageSummary
+ get(const coverage::FunctionCoverageMapping &Function);
};
/// \brief A summary of file's code coverage.
+++ /dev/null
-//===- FunctionCoverageMapping.h - Function coverage mapping record -------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// A structure that stores the coverage mapping record for a single function.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_COV_FUNCTIONCOVERAGEMAPPING_H
-#define LLVM_COV_FUNCTIONCOVERAGEMAPPING_H
-
-#include <string>
-#include <vector>
-#include "llvm/ADT/ArrayRef.h"
-#include "llvm/ADT/StringRef.h"
-#include "llvm/ProfileData/CoverageMapping.h"
-
-namespace llvm {
-
-/// \brief Stores all the required information
-/// about code coverage for a single function.
-struct FunctionCoverageMapping {
- /// \brief Raw function name.
- std::string Name;
- std::vector<std::string> Filenames;
- std::vector<coverage::CountedRegion> CountedRegions;
-
- FunctionCoverageMapping(StringRef Name, ArrayRef<StringRef> Filenames)
- : Name(Name), Filenames(Filenames.begin(), Filenames.end()) {}
-};
-
-} // namespace llvm
-
-#endif // LLVM_COV_FUNCTIONCOVERAGEMAPPING_H
#ifndef LLVM_COV_SOURCECOVERAGEDATAMANAGER_H
#define LLVM_COV_SOURCECOVERAGEDATAMANAGER_H
-#include "FunctionCoverageMapping.h"
#include "llvm/ProfileData/CoverageMapping.h"
#include <vector>