mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-11 06:38:20 +00:00
llvm-cov: Move FunctionCoverageMapping into CoverageMapping.h (NFC)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@217657 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -220,6 +220,19 @@ public:
|
|||||||
ErrorOr<int64_t> evaluate(const Counter &C) const;
|
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 coverage
|
||||||
} // end namespace llvm
|
} // end namespace llvm
|
||||||
|
|
||||||
|
@ -13,7 +13,6 @@
|
|||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
#include "FunctionCoverageMapping.h"
|
|
||||||
#include "RenderingSupport.h"
|
#include "RenderingSupport.h"
|
||||||
#include "CoverageViewOptions.h"
|
#include "CoverageViewOptions.h"
|
||||||
#include "CoverageFilters.h"
|
#include "CoverageFilters.h"
|
||||||
|
@ -14,12 +14,14 @@
|
|||||||
#ifndef LLVM_COV_COVERAGEFILTERS_H
|
#ifndef LLVM_COV_COVERAGEFILTERS_H
|
||||||
#define LLVM_COV_COVERAGEFILTERS_H
|
#define LLVM_COV_COVERAGEFILTERS_H
|
||||||
|
|
||||||
#include "FunctionCoverageMapping.h"
|
#include "llvm/ProfileData/CoverageMapping.h"
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
namespace llvm {
|
namespace llvm {
|
||||||
|
|
||||||
|
using coverage::FunctionCoverageMapping;
|
||||||
|
|
||||||
/// \brief Matches specific functions that pass the requirement of this filter.
|
/// \brief Matches specific functions that pass the requirement of this filter.
|
||||||
class CoverageFilter {
|
class CoverageFilter {
|
||||||
public:
|
public:
|
||||||
|
@ -27,8 +27,8 @@ unsigned CoverageSummary::getFileID(StringRef Filename) {
|
|||||||
return Filenames.size() - 1;
|
return Filenames.size() - 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void CoverageSummary::createSummaries(
|
||||||
CoverageSummary::createSummaries(ArrayRef<FunctionCoverageMapping> Functions) {
|
ArrayRef<coverage::FunctionCoverageMapping> Functions) {
|
||||||
std::vector<std::pair<unsigned, size_t>> FunctionFileIDs;
|
std::vector<std::pair<unsigned, size_t>> FunctionFileIDs;
|
||||||
|
|
||||||
FunctionFileIDs.resize(Functions.size());
|
FunctionFileIDs.resize(Functions.size());
|
||||||
|
@ -30,7 +30,7 @@ class CoverageSummary {
|
|||||||
unsigned getFileID(StringRef Filename);
|
unsigned getFileID(StringRef Filename);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void createSummaries(ArrayRef<FunctionCoverageMapping> Functions);
|
void createSummaries(ArrayRef<coverage::FunctionCoverageMapping> Functions);
|
||||||
|
|
||||||
ArrayRef<FileCoverageSummary> getFileSummaries() { return FileSummaries; }
|
ArrayRef<FileCoverageSummary> getFileSummaries() { return FileSummaries; }
|
||||||
|
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
#ifndef LLVM_COV_COVERAGESUMMARYINFO_H
|
#ifndef LLVM_COV_COVERAGESUMMARYINFO_H
|
||||||
#define LLVM_COV_COVERAGESUMMARYINFO_H
|
#define LLVM_COV_COVERAGESUMMARYINFO_H
|
||||||
|
|
||||||
#include "FunctionCoverageMapping.h"
|
#include "llvm/ProfileData/CoverageMapping.h"
|
||||||
#include "llvm/Support/raw_ostream.h"
|
#include "llvm/Support/raw_ostream.h"
|
||||||
|
|
||||||
namespace llvm {
|
namespace llvm {
|
||||||
@ -100,7 +100,8 @@ struct FunctionCoverageSummary {
|
|||||||
|
|
||||||
/// \brief Compute the code coverage summary for the given function coverage
|
/// \brief Compute the code coverage summary for the given function coverage
|
||||||
/// mapping record.
|
/// mapping record.
|
||||||
static FunctionCoverageSummary get(const FunctionCoverageMapping &Function);
|
static FunctionCoverageSummary
|
||||||
|
get(const coverage::FunctionCoverageMapping &Function);
|
||||||
};
|
};
|
||||||
|
|
||||||
/// \brief A summary of file's code coverage.
|
/// \brief A summary of file's code coverage.
|
||||||
|
@ -1,39 +0,0 @@
|
|||||||
//===- 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
|
|
@ -14,7 +14,6 @@
|
|||||||
#ifndef LLVM_COV_SOURCECOVERAGEDATAMANAGER_H
|
#ifndef LLVM_COV_SOURCECOVERAGEDATAMANAGER_H
|
||||||
#define LLVM_COV_SOURCECOVERAGEDATAMANAGER_H
|
#define LLVM_COV_SOURCECOVERAGEDATAMANAGER_H
|
||||||
|
|
||||||
#include "FunctionCoverageMapping.h"
|
|
||||||
#include "llvm/ProfileData/CoverageMapping.h"
|
#include "llvm/ProfileData/CoverageMapping.h"
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user