From 090b50ca27d8fbc511d35dc67e6afb443b3f84c3 Mon Sep 17 00:00:00 2001 From: Justin Bogner Date: Thu, 26 Feb 2015 20:06:24 +0000 Subject: [PATCH] InstrProf: Rename ObjectFileCoverageMappingReader to BinaryCoverageReader The current name is long and confusing. A shorter one is both easier to understand and easier to work with. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230675 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/ProfileData/CoverageMappingReader.h | 10 ++++------ lib/ProfileData/CoverageMapping.cpp | 2 +- lib/ProfileData/CoverageMappingReader.cpp | 10 +++++----- 3 files changed, 10 insertions(+), 12 deletions(-) diff --git a/include/llvm/ProfileData/CoverageMappingReader.h b/include/llvm/ProfileData/CoverageMappingReader.h index cd4469c0666..8226793a5d0 100644 --- a/include/llvm/ProfileData/CoverageMappingReader.h +++ b/include/llvm/ProfileData/CoverageMappingReader.h @@ -142,7 +142,7 @@ private: /// \brief Reader for the coverage mapping data that is emitted by the /// frontend and stored in an object file. -class ObjectFileCoverageMappingReader : public CoverageMappingReader { +class BinaryCoverageReader : public CoverageMappingReader { public: struct ProfileMappingRecord { CoverageMappingVersion Version; @@ -170,10 +170,8 @@ private: std::vector Expressions; std::vector MappingRegions; - ObjectFileCoverageMappingReader(const ObjectFileCoverageMappingReader &) - = delete; - ObjectFileCoverageMappingReader & - operator=(const ObjectFileCoverageMappingReader &) = delete; + BinaryCoverageReader(const BinaryCoverageReader &) = delete; + BinaryCoverageReader &operator=(const BinaryCoverageReader &) = delete; /// \brief Set the current error_code and return same. std::error_code error(std::error_code EC) { @@ -185,7 +183,7 @@ private: std::error_code success() { return error(instrprof_error::success); } public: - ObjectFileCoverageMappingReader(std::unique_ptr &ObjectBuffer); + BinaryCoverageReader(std::unique_ptr &ObjectBuffer); std::error_code readHeader(); std::error_code readNextRecord(CoverageMappingRecord &Record) override; diff --git a/lib/ProfileData/CoverageMapping.cpp b/lib/ProfileData/CoverageMapping.cpp index da619e1bf9f..915aae3e594 100644 --- a/lib/ProfileData/CoverageMapping.cpp +++ b/lib/ProfileData/CoverageMapping.cpp @@ -221,7 +221,7 @@ CoverageMapping::load(StringRef ObjectFilename, StringRef ProfileFilename) { auto CounterMappingBuff = MemoryBuffer::getFileOrSTDIN(ObjectFilename); if (auto EC = CounterMappingBuff.getError()) return EC; - ObjectFileCoverageMappingReader CoverageReader(CounterMappingBuff.get()); + BinaryCoverageReader CoverageReader(CounterMappingBuff.get()); if (auto EC = CoverageReader.readHeader()) return EC; auto ProfileReaderOrErr = IndexedInstrProfReader::create(ProfileFilename); diff --git a/lib/ProfileData/CoverageMappingReader.cpp b/lib/ProfileData/CoverageMappingReader.cpp index f09ddeb37e8..168115a1534 100644 --- a/lib/ProfileData/CoverageMappingReader.cpp +++ b/lib/ProfileData/CoverageMappingReader.cpp @@ -334,7 +334,7 @@ struct SectionData { template std::error_code readCoverageMappingData( SectionData &ProfileNames, StringRef Data, - std::vector &Records, + std::vector &Records, std::vector &Filenames) { llvm::DenseSet UniqueFunctionMappingData; @@ -400,7 +400,7 @@ std::error_code readCoverageMappingData( ProfileNames.get(MappingRecord.FunctionNamePtr, MappingRecord.FunctionNameSize, FunctionName)) return Err; - Records.push_back(ObjectFileCoverageMappingReader::ProfileMappingRecord( + Records.push_back(BinaryCoverageReader::ProfileMappingRecord( Version, FunctionName, MappingRecord.FunctionHash, Mapping, FilenamesBegin, Filenames.size() - FilenamesBegin)); } @@ -438,7 +438,7 @@ static std::error_code decodeTestingFormat(StringRef Data, return instrprof_error::success; } -ObjectFileCoverageMappingReader::ObjectFileCoverageMappingReader( +BinaryCoverageReader::BinaryCoverageReader( std::unique_ptr &ObjectBuffer) : CurrentRecord(0) { if (ObjectBuffer->getBuffer().startswith(TestingFormatMagic)) { @@ -466,7 +466,7 @@ ObjectFileCoverageMappingReader::ObjectFileCoverageMappingReader( std::move(ObjectBuffer)); } -std::error_code ObjectFileCoverageMappingReader::readHeader() { +std::error_code BinaryCoverageReader::readHeader() { const ObjectFile *OF = Object.getBinary(); if (!OF) return getError(); @@ -515,7 +515,7 @@ std::error_code ObjectFileCoverageMappingReader::readHeader() { } std::error_code -ObjectFileCoverageMappingReader::readNextRecord(CoverageMappingRecord &Record) { +BinaryCoverageReader::readNextRecord(CoverageMappingRecord &Record) { if (CurrentRecord >= MappingRecords.size()) return error(instrprof_error::eof); -- 2.34.1