diff --git a/llvm/docs/ReleaseNotes.rst b/llvm/docs/ReleaseNotes.rst --- a/llvm/docs/ReleaseNotes.rst +++ b/llvm/docs/ReleaseNotes.rst @@ -206,6 +206,7 @@ introduction of alternatives to zlib compression in the llvm toolchain. Changes are as follows: * Relocate the ``llvm::zlib`` namespace to ``llvm::compression::zlib``. + * Remove crc32 from zlib compression namespace, people should use the ``llvm::crc32`` instead. Changes to the Go bindings -------------------------- diff --git a/llvm/include/llvm/Support/Compression.h b/llvm/include/llvm/Support/Compression.h --- a/llvm/include/llvm/Support/Compression.h +++ b/llvm/include/llvm/Support/Compression.h @@ -41,8 +41,6 @@ SmallVectorImpl &UncompressedBuffer, size_t UncompressedSize); -uint32_t crc32(StringRef Buffer); - } // End of namespace zlib } // End of namespace compression diff --git a/llvm/lib/Support/Compression.cpp b/llvm/lib/Support/Compression.cpp --- a/llvm/lib/Support/Compression.cpp +++ b/llvm/lib/Support/Compression.cpp @@ -83,10 +83,6 @@ return E; } -uint32_t zlib::crc32(StringRef Buffer) { - return ::crc32(0, (const Bytef *)Buffer.data(), Buffer.size()); -} - #else bool zlib::isAvailable() { return false; } void zlib::compress(StringRef InputBuffer, @@ -102,7 +98,4 @@ size_t UncompressedSize) { llvm_unreachable("zlib::uncompress is unavailable"); } -uint32_t zlib::crc32(StringRef Buffer) { - llvm_unreachable("zlib::crc32 is unavailable"); -} #endif diff --git a/llvm/unittests/Support/CompressionTest.cpp b/llvm/unittests/Support/CompressionTest.cpp --- a/llvm/unittests/Support/CompressionTest.cpp +++ b/llvm/unittests/Support/CompressionTest.cpp @@ -63,12 +63,6 @@ TestZlibCompression(BinaryDataStr, zlib::DefaultCompression); } -TEST(CompressionTest, ZlibCRC32) { - EXPECT_EQ( - 0x414FA339U, - zlib::crc32(StringRef("The quick brown fox jumps over the lazy dog"))); -} - #endif }