15 #ifndef LLVM_PROFILEDATA_COVERAGEMAPPINGREADER_H
16 #define LLVM_PROFILEDATA_COVERAGEMAPPINGREADER_H
31 class CoverageMappingReader;
44 :
public std::iterator<std::input_iterator_tag, CoverageMappingRecord> {
61 return Reader == RHS.Reader;
64 return Reader != RHS.Reader;
93 std::vector<StringRef> &Filenames;
119 std::vector<StringRef> &Filenames;
120 std::vector<CounterExpression> &Expressions;
121 std::vector<CounterMappingRegion> &MappingRegions;
130 std::vector<StringRef> &Filenames,
131 std::vector<CounterExpression> &Expressions,
132 std::vector<CounterMappingRegion> &MappingRegions)
134 TranslationUnitFilenames(TranslationUnitFilenames),
135 Filenames(Filenames), Expressions(Expressions),
136 MappingRegions(MappingRegions) {}
144 readMappingRegionsSubArray(std::vector<CounterMappingRegion> &MappingRegions,
145 unsigned InferredFileID,
size_t NumFileIDs);
163 : Version(Version), FunctionName(FunctionName),
164 FunctionHash(FunctionHash), CoverageMapping(CoverageMapping),
165 FilenamesBegin(FilenamesBegin), FilenamesSize(FilenamesSize) {}
169 std::vector<StringRef> Filenames;
170 std::vector<ProfileMappingRecord> MappingRecords;
172 size_t CurrentRecord;
173 std::vector<StringRef> FunctionsFilenames;
174 std::vector<CounterExpression> Expressions;
175 std::vector<CounterMappingRegion> MappingRegions;
184 create(std::unique_ptr<MemoryBuffer> &ObjectBuffer,
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.
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
ArrayRef< StringRef > Filenames
virtual ~CoverageMappingReader()
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.
static Expected< std::unique_ptr< BinaryCoverageReader > > create(std::unique_ptr< MemoryBuffer > &ObjectBuffer, StringRef Arch)
static GCRegistry::Add< ShadowStackGC > C("shadow-stack","Very portable GC for uncooperative code generators")
CoverageMappingIterator()
CoverageMappingIterator end()
The mapping of profile information to coverage data.
virtual Error readNextRecord(CoverageMappingRecord &Record)=0
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...