15 #ifndef LLVM_PROFILEDATA_COVERAGE_COVERAGEMAPPINGREADER_H
16 #define LLVM_PROFILEDATA_COVERAGE_COVERAGEMAPPINGREADER_H
33 class CoverageMappingReader;
46 :
public std::iterator<std::input_iterator_tag, CoverageMappingRecord> {
64 return Reader == RHS.Reader;
67 return Reader != RHS.Reader;
97 std::vector<StringRef> &Filenames;
122 std::vector<StringRef> &Filenames;
123 std::vector<CounterExpression> &Expressions;
124 std::vector<CounterMappingRegion> &MappingRegions;
129 std::vector<StringRef> &Filenames,
130 std::vector<CounterExpression> &Expressions,
131 std::vector<CounterMappingRegion> &MappingRegions)
133 TranslationUnitFilenames(TranslationUnitFilenames),
134 Filenames(Filenames), Expressions(Expressions),
135 MappingRegions(MappingRegions) {}
146 readMappingRegionsSubArray(std::vector<CounterMappingRegion> &MappingRegions,
147 unsigned InferredFileID,
size_t NumFileIDs);
165 : Version(Version), FunctionName(FunctionName),
166 FunctionHash(FunctionHash), CoverageMapping(CoverageMapping),
167 FilenamesBegin(FilenamesBegin), FilenamesSize(FilenamesSize) {}
171 std::vector<StringRef> Filenames;
172 std::vector<ProfileMappingRecord> MappingRecords;
174 size_t CurrentRecord = 0;
175 std::vector<StringRef> FunctionsFilenames;
176 std::vector<CounterExpression> Expressions;
177 std::vector<CounterMappingRegion> MappingRegions;
186 create(std::unique_ptr<MemoryBuffer> &ObjectBuffer,
195 #endif // LLVM_PROFILEDATA_COVERAGE_COVERAGEMAPPINGREADER_H
CoverageMappingIterator begin()
A symbol table used for function PGO name look-up with keys (such as pointers, md5hash values) to the...
Reader for the raw coverage mapping data.
RawCoverageFilenamesReader(StringRef Data, std::vector< StringRef > &Filenames)
Base class for the raw coverage mapping and filenames data readers.
CoverageMappingIterator(CoverageMappingReader *Reader)
Checks if the given coverage mapping data is exported for an unused function.
RawCoverageFilenamesReader & operator=(const RawCoverageFilenamesReader &)=delete
RawCoverageMappingDummyChecker(StringRef MappingData)
CoverageMappingRecord * operator->()
ArrayRef< CounterMappingRegion > MappingRegions
CoverageMappingRecord & operator*()
Error readSize(uint64_t &Result)
Reader for the coverage mapping data that is emitted by the frontend and stored in an object file...
RawCoverageMappingReader(StringRef MappingData, ArrayRef< StringRef > TranslationUnitFilenames, std::vector< StringRef > &Filenames, std::vector< CounterExpression > &Expressions, std::vector< CounterMappingRegion > &MappingRegions)
ArrayRef< CounterExpression > Expressions
Tagged union holding either a T or a Error.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory)...
RawCoverageReader(StringRef Data)
StringRef CoverageMapping
Error readIntMax(uint64_t &Result, uint64_t MaxPlus1)
Error readNextRecord(CoverageMappingRecord &Record) override
virtual ~CoverageMappingReader()=default
ArrayRef< StringRef > Filenames
Coverage mapping information for a single function.
Reader for the raw coverage filenames.
Error readULEB128(uint64_t &Result)
Expected< bool > isDummy()
Error readString(StringRef &Result)
bool operator==(const CoverageMappingIterator &RHS)
A file format agnostic iterator over coverage mapping data.
BinaryCoverageReader & operator=(const BinaryCoverageReader &)=delete
static Expected< std::unique_ptr< BinaryCoverageReader > > create(std::unique_ptr< MemoryBuffer > &ObjectBuffer, StringRef Arch)
CoverageMappingIterator end()
The mapping of profile information to coverage data.
virtual Error readNextRecord(CoverageMappingRecord &Record)=0
RawCoverageMappingReader & operator=(const RawCoverageMappingReader &)=delete
ProfileMappingRecord(CovMapVersion Version, StringRef FunctionName, uint64_t FunctionHash, StringRef CoverageMapping, size_t FilenamesBegin, size_t FilenamesSize)
LLVM Value Representation.
CoverageMappingIterator & operator++()
Lightweight error class with error context and mandatory checking.
CoverageMappingIterator()=default
StringRef - Represent a constant reference to a string, i.e.
bool operator!=(const CoverageMappingIterator &RHS)
A Counter is an abstract value that describes how to compute the execution count for a region of code...