From 1f917f69ff07f09b6dbb670971f57f8efe718b84 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Thu, 14 Jul 2022 20:50:02 +0200 Subject: Vendor import of llvm-project main llvmorg-15-init-16436-g18a6ab5b8d1f. --- llvm/lib/ProfileData/SampleProfReader.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'llvm/lib/ProfileData/SampleProfReader.cpp') 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(Data), - *CompressSize); - char *Buffer = Allocator.Allocate(DecompressBufSize); + uint8_t *Buffer = Allocator.Allocate(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(Buffer); -- cgit v1.3