summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
Diffstat (limited to 'llvm')
-rw-r--r--llvm/include/llvm/ProfileData/CoverageMapping.h8
-rw-r--r--llvm/include/llvm/ProfileData/CoverageMappingReader.h4
-rw-r--r--llvm/include/llvm/ProfileData/InstrProfData.inc2
-rw-r--r--llvm/lib/ProfileData/CoverageMappingReader.cpp18
4 files changed, 15 insertions, 17 deletions
diff --git a/llvm/include/llvm/ProfileData/CoverageMapping.h b/llvm/include/llvm/ProfileData/CoverageMapping.h
index 1d4d277e187..b667c4949ac 100644
--- a/llvm/include/llvm/ProfileData/CoverageMapping.h
+++ b/llvm/include/llvm/ProfileData/CoverageMapping.h
@@ -537,10 +537,10 @@ struct CovMapHeader {
LLVM_PACKED_END
-enum CoverageMappingVersion {
- CoverageMappingVersion1 = 0,
- // The current versin is Version1
- CoverageMappingCurrentVersion = INSTR_PROF_COVMAP_VERSION
+enum CovMapVersion {
+ Version1 = 0,
+ // The current version is Version1
+ CurrentVersion = INSTR_PROF_COVMAP_VERSION
};
template <int CovMapVersion, class IntPtrT> struct CovMapTraits {
diff --git a/llvm/include/llvm/ProfileData/CoverageMappingReader.h b/llvm/include/llvm/ProfileData/CoverageMappingReader.h
index 38fb4680476..f03090e2921 100644
--- a/llvm/include/llvm/ProfileData/CoverageMappingReader.h
+++ b/llvm/include/llvm/ProfileData/CoverageMappingReader.h
@@ -140,14 +140,14 @@ private:
class BinaryCoverageReader : public CoverageMappingReader {
public:
struct ProfileMappingRecord {
- CoverageMappingVersion Version;
+ CovMapVersion Version;
StringRef FunctionName;
uint64_t FunctionHash;
StringRef CoverageMapping;
size_t FilenamesBegin;
size_t FilenamesSize;
- ProfileMappingRecord(CoverageMappingVersion Version, StringRef FunctionName,
+ ProfileMappingRecord(CovMapVersion Version, StringRef FunctionName,
uint64_t FunctionHash, StringRef CoverageMapping,
size_t FilenamesBegin, size_t FilenamesSize)
: Version(Version), FunctionName(FunctionName),
diff --git a/llvm/include/llvm/ProfileData/InstrProfData.inc b/llvm/include/llvm/ProfileData/InstrProfData.inc
index 33c7d94aea2..e6e23a76209 100644
--- a/llvm/include/llvm/ProfileData/InstrProfData.inc
+++ b/llvm/include/llvm/ProfileData/InstrProfData.inc
@@ -182,7 +182,7 @@ COVMAP_HEADER(uint32_t, Int32Ty, FilenamesSize, \
COVMAP_HEADER(uint32_t, Int32Ty, CoverageSize, \
llvm::ConstantInt::get(Int32Ty, CoverageMappingSize))
COVMAP_HEADER(uint32_t, Int32Ty, Version, \
- llvm::ConstantInt::get(Int32Ty, CoverageMappingCurrentVersion))
+ llvm::ConstantInt::get(Int32Ty, CovMapVersion::CurrentVersion))
#undef COVMAP_HEADER
/* COVMAP_HEADER end. */
diff --git a/llvm/lib/ProfileData/CoverageMappingReader.cpp b/llvm/lib/ProfileData/CoverageMappingReader.cpp
index 4137b1715c2..c8948d61c5e 100644
--- a/llvm/lib/ProfileData/CoverageMappingReader.cpp
+++ b/llvm/lib/ProfileData/CoverageMappingReader.cpp
@@ -316,13 +316,13 @@ struct CovMapFuncRecordReader {
virtual ~CovMapFuncRecordReader() {}
template <class IntPtrT, support::endianness Endian>
static std::unique_ptr<CovMapFuncRecordReader>
- get(coverage::CoverageMappingVersion Version, InstrProfSymtab &P,
+ get(coverage::CovMapVersion Version, InstrProfSymtab &P,
std::vector<BinaryCoverageReader::ProfileMappingRecord> &R,
std::vector<StringRef> &F);
};
// A class for reading coverage mapping function records for a module.
-template <coverage::CoverageMappingVersion CovMapVersion, class IntPtrT,
+template <coverage::CovMapVersion CovMapVersion, class IntPtrT,
support::endianness Endian>
class VersionedCovMapFuncRecordReader : public CovMapFuncRecordReader {
typedef typename coverage::CovMapTraits<
@@ -352,8 +352,7 @@ public:
uint32_t NRecords = CovHeader->getNRecords<Endian>();
uint32_t FilenamesSize = CovHeader->getFilenamesSize<Endian>();
uint32_t CoverageSize = CovHeader->getCoverageSize<Endian>();
- assert((CoverageMappingVersion)CovHeader->getVersion<Endian>() ==
- CovMapVersion);
+ assert((CovMapVersion)CovHeader->getVersion<Endian>() == CovMapVersion);
Buf = reinterpret_cast<const char *>(CovHeader + 1);
// Skip past the function records, saving the start and end for later.
@@ -415,14 +414,14 @@ public:
template <class IntPtrT, support::endianness Endian>
std::unique_ptr<CovMapFuncRecordReader> CovMapFuncRecordReader::get(
- coverage::CoverageMappingVersion Version, InstrProfSymtab &P,
+ coverage::CovMapVersion Version, InstrProfSymtab &P,
std::vector<BinaryCoverageReader::ProfileMappingRecord> &R,
std::vector<StringRef> &F) {
using namespace coverage;
switch (Version) {
- case CoverageMappingVersion1:
+ case CovMapVersion::Version1:
return llvm::make_unique<VersionedCovMapFuncRecordReader<
- CoverageMappingVersion1, IntPtrT, Endian>>(P, R, F);
+ CovMapVersion::Version1, IntPtrT, Endian>>(P, R, F);
}
llvm_unreachable("Unsupported version");
}
@@ -436,9 +435,8 @@ static std::error_code readCoverageMappingData(
// Read the records in the coverage data section.
auto CovHeader =
reinterpret_cast<const coverage::CovMapHeader *>(Data.data());
- CoverageMappingVersion Version =
- (CoverageMappingVersion)CovHeader->getVersion<Endian>();
- if (Version > coverage::CoverageMappingCurrentVersion)
+ CovMapVersion Version = (CovMapVersion)CovHeader->getVersion<Endian>();
+ if (Version > coverage::CovMapVersion::CurrentVersion)
return coveragemap_error::unsupported_version;
std::unique_ptr<CovMapFuncRecordReader> Reader =
CovMapFuncRecordReader::get<T, Endian>(Version, ProfileNames, Records,
OpenPOWER on IntegriCloud