diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2022-07-14 18:50:02 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2022-07-14 18:50:02 +0000 |
| commit | 1f917f69ff07f09b6dbb670971f57f8efe718b84 (patch) | |
| tree | 99293cbc1411737cd995dac10a99b2c40ef0944c /llvm/lib/ProfileData/SampleProfReader.cpp | |
| parent | 145449b1e420787bb99721a429341fa6be3adfb6 (diff) | |
Diffstat (limited to 'llvm/lib/ProfileData/SampleProfReader.cpp')
| -rw-r--r-- | llvm/lib/ProfileData/SampleProfReader.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/llvm/lib/ProfileData/SampleProfReader.cpp b/llvm/lib/ProfileData/SampleProfReader.cpp index 280e3c6cb8d1..204e34bff879 100644 --- a/llvm/lib/ProfileData/SampleProfReader.cpp +++ b/llvm/lib/ProfileData/SampleProfReader.cpp @@ -877,15 +877,13 @@ std::error_code SampleProfileReaderExtBinaryBase::decompressSection( if (std::error_code EC = CompressSize.getError()) return EC; - if (!llvm::zlib::isAvailable()) + if (!llvm::compression::zlib::isAvailable()) return sampleprof_error::zlib_unavailable; - StringRef CompressedStrings(reinterpret_cast<const char *>(Data), - *CompressSize); - char *Buffer = Allocator.Allocate<char>(DecompressBufSize); + uint8_t *Buffer = Allocator.Allocate<uint8_t>(DecompressBufSize); size_t UCSize = DecompressBufSize; - llvm::Error E = - zlib::uncompress(CompressedStrings, Buffer, UCSize); + llvm::Error E = compression::zlib::uncompress( + makeArrayRef(Data, *CompressSize), Buffer, UCSize); if (E) return sampleprof_error::uncompress_failed; DecompressBuf = reinterpret_cast<const uint8_t *>(Buffer); |
