diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2023-04-14 21:41:27 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2023-06-22 18:20:56 +0000 |
commit | bdd1243df58e60e85101c09001d9812a789b6bc4 (patch) | |
tree | a1ce621c7301dd47ba2ddc3b8eaa63b441389481 /contrib/llvm-project/llvm/lib/ProfileData/Coverage/CoverageMappingReader.cpp | |
parent | 781624ca2d054430052c828ba8d2c2eaf2d733e7 (diff) | |
parent | e3b557809604d036af6e00c60f012c2025b59a5e (diff) |
Diffstat (limited to 'contrib/llvm-project/llvm/lib/ProfileData/Coverage/CoverageMappingReader.cpp')
-rw-r--r-- | contrib/llvm-project/llvm/lib/ProfileData/Coverage/CoverageMappingReader.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/contrib/llvm-project/llvm/lib/ProfileData/Coverage/CoverageMappingReader.cpp b/contrib/llvm-project/llvm/lib/ProfileData/Coverage/CoverageMappingReader.cpp index 552140a52ad4..41962ab24ff9 100644 --- a/contrib/llvm-project/llvm/lib/ProfileData/Coverage/CoverageMappingReader.cpp +++ b/contrib/llvm-project/llvm/lib/ProfileData/Coverage/CoverageMappingReader.cpp @@ -129,7 +129,7 @@ Error RawCoverageFilenamesReader::read(CovMapVersion Version) { // Read compressed filenames. StringRef CompressedFilenames = Data.substr(0, CompressedLen); Data = Data.substr(CompressedLen); - auto Err = compression::zlib::uncompress( + auto Err = compression::zlib::decompress( arrayRefFromStringRef(CompressedFilenames), StorageBuf, UncompressedLen); if (Err) { @@ -517,11 +517,11 @@ struct CovMapFuncRecordReader { // // Prior to Version4, \p OutOfLineMappingBuf points to a sequence of coverage // mappings associated with the function records. It is unused in Version4. - virtual Error readFunctionRecords(const char *FuncRecBuf, - const char *FuncRecBufEnd, - Optional<FilenameRange> OutOfLineFileRange, - const char *OutOfLineMappingBuf, - const char *OutOfLineMappingBufEnd) = 0; + virtual Error + readFunctionRecords(const char *FuncRecBuf, const char *FuncRecBufEnd, + std::optional<FilenameRange> OutOfLineFileRange, + const char *OutOfLineMappingBuf, + const char *OutOfLineMappingBufEnd) = 0; template <class IntPtrT, support::endianness Endian> static Expected<std::unique_ptr<CovMapFuncRecordReader>> @@ -695,7 +695,7 @@ public: } Error readFunctionRecords(const char *FuncRecBuf, const char *FuncRecBufEnd, - Optional<FilenameRange> OutOfLineFileRange, + std::optional<FilenameRange> OutOfLineFileRange, const char *OutOfLineMappingBuf, const char *OutOfLineMappingBufEnd) override { auto CFR = reinterpret_cast<const FuncRecordType *>(FuncRecBuf); @@ -710,7 +710,7 @@ public: return make_error<CoverageMapError>(coveragemap_error::malformed); // Look up the set of filenames associated with this function record. - Optional<FilenameRange> FileRange; + std::optional<FilenameRange> FileRange; if (Version < CovMapVersion::Version4) { FileRange = OutOfLineFileRange; } else { @@ -817,8 +817,8 @@ static Error readCoverageMappingData( // In Version4, function records are not affixed to coverage headers. Read // the records from their dedicated section. if (Version >= CovMapVersion::Version4) - return Reader->readFunctionRecords(FuncRecBuf, FuncRecBufEnd, None, nullptr, - nullptr); + return Reader->readFunctionRecords(FuncRecBuf, FuncRecBufEnd, std::nullopt, + nullptr, nullptr); return Error::success(); } @@ -1161,7 +1161,7 @@ Error BinaryCoverageReader::readNextRecord(CoverageMappingRecord &Record) { Expressions.clear(); MappingRegions.clear(); auto &R = MappingRecords[CurrentRecord]; - auto F = makeArrayRef(Filenames).slice(R.FilenamesBegin, R.FilenamesSize); + auto F = ArrayRef(Filenames).slice(R.FilenamesBegin, R.FilenamesSize); RawCoverageMappingReader Reader(R.CoverageMapping, F, FunctionsFilenames, Expressions, MappingRegions); if (auto Err = Reader.read()) |