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> {
72 return Reader == RHS.Reader;
75 return Reader != RHS.Reader;
79 auto E = make_error<CoverageMapError>(ReadErr);
87 auto E = make_error<CoverageMapError>(ReadErr);
112 Error readIntMax(uint64_t &Result, uint64_t MaxPlus1);
113 Error readSize(uint64_t &Result);
151 std::vector<StringRef> &Filenames,
152 std::vector<CounterExpression> &Expressions,
153 std::vector<CounterMappingRegion> &MappingRegions)
155 TranslationUnitFilenames(TranslationUnitFilenames),
156 Filenames(Filenames), Expressions(Expressions),
157 MappingRegions(MappingRegions) {}
168 readMappingRegionsSubArray(std::vector<CounterMappingRegion> &MappingRegions,
169 unsigned InferredFileID,
size_t NumFileIDs);
185 uint64_t FunctionHash,
StringRef CoverageMapping,
186 size_t FilenamesBegin,
size_t FilenamesSize)
187 : Version(Version), FunctionName(FunctionName),
188 FunctionHash(FunctionHash), CoverageMapping(CoverageMapping),
189 FilenamesBegin(FilenamesBegin), FilenamesSize(FilenamesSize) {}
194 std::vector<ProfileMappingRecord> MappingRecords;
196 size_t CurrentRecord = 0;
197 std::vector<StringRef> FunctionsFilenames;
208 create(std::unique_ptr<MemoryBuffer> &ObjectBuffer,
217 #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)
This class represents lattice values for constants.
Base class for the raw coverage mapping and filenames data readers.
~CoverageMappingIterator()
CoverageMappingIterator(CoverageMappingReader *Reader)
Checks if the given coverage mapping data is exported for an unused function.
RawCoverageMappingDummyChecker(StringRef MappingData)
ArrayRef< CounterMappingRegion > MappingRegions
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.
static uint64_t readULEB128(WasmObjectFile::ReadContext &Ctx)
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory)...
RawCoverageReader(StringRef Data)
StringRef CoverageMapping
ArrayRef< StringRef > Filenames
Coverage mapping information for a single function.
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
Reader for the raw coverage filenames.
bool operator==(const CoverageMappingIterator &RHS)
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
A file format agnostic iterator over coverage mapping data.
Expected< CoverageMappingRecord & > operator*()
Expected< CoverageMappingRecord * > operator->()
CoverageMappingIterator()
static StringRef readString(WasmObjectFile::ReadContext &Ctx)
CoverageMappingIterator end()
value_type read(const void *memory, endianness endian)
Read a value of a particular endianness from memory.
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.
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...