[PATCH] D68570: Unify the two CRC implementations

Aditya Kumar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 7 12:16:23 PDT 2019


hiraditya added inline comments.


================
Comment at: llvm/lib/Support/CRC.cpp:26
 
-uint32_t llvm::crc32(uint32_t CRC, StringRef S) {
-  static llvm::once_flag InitFlag;
-  static CRC32Table Tbl;
-  llvm::call_once(InitFlag, initCRC32Table, &Tbl);
+static const uint32_t CRCTable[256] = {
+    0x00000000, 0x77073096, 0xee0e612c, 0x990951ba,
----------------
rupprecht wrote:
> Can you leave a comment how this table was generated/how it could be regenerated if needed in the future? And/or a unit test to assert the values are correct?
+1


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

https://reviews.llvm.org/D68570





More information about the llvm-commits mailing list