[PATCH] D59816: [Support] Implement zlib independent crc32 computation

Eugene Leviant via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 26 06:01:06 PDT 2019


evgeny777 marked 2 inline comments as done.
evgeny777 added inline comments.


================
Comment at: include/llvm/Support/CRC.h:22
+// zlib independent CRC32 calculation.
+uint32_t getCRC32(uint32_t CRC, StringRef S);
+} // end namespace llvm
----------------
lebedev.ri wrote:
> I'm not sure if oss-fuzz builds llvm with zlib or not, but if it **does**,
> this is a *great* fuzzing target, to cross-check with the zlib output.
LLVM_ENABLE_ZLIB is ON by default, so whether LLVM is built with zlib support or not depends on HAVE_ZLIB_H.
Are you suggesting something like `llvm-crc32-fuzzer`?


================
Comment at: lib/DebugInfo/Symbolize/Symbolize.cpp:167
     return false;
-  return !zlib::isAvailable() || CRCHash == zlib::crc32(MB.get()->getBuffer());
+  return CRCHash == (zlib::isAvailable()
+                         ? zlib::crc32(MB.get()->getBuffer())
----------------
grimar wrote:
> What about always using non-zlib implementation?
zlib implementation is most likely faster, especially with -DBYFOUR. Also somebody may be using llvm::zlib::crc32 



CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D59816/new/

https://reviews.llvm.org/D59816





More information about the llvm-commits mailing list