[PATCH] D68570: Unify the two CRC implementations

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 7 23:02:37 PDT 2019


ruiu added inline comments.


================
Comment at: llvm/include/llvm/Support/JamCRC.h:45
+    CRC ^= 0xFFFFFFFFU; // Undo CRC-32 Init.
+    CRC = llvm::crc32(CRC, Data);
+    CRC ^= 0xFFFFFFFFU; // Undo CRC-32 XorOut.
----------------
This is the only place where you pass non-zero value as the first argument, and the way how that value is handled is a little irregular. So how about moving this class to CRC.h and define `llvm::crc32` as `llvm::crc32(ArrayRef<uint8_t>)`?


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

https://reviews.llvm.org/D68570





More information about the llvm-commits mailing list