dblaikie added inline comments.

================
Comment at: clang/lib/Serialization/ASTReader.cpp:1457
+      const llvm::compression::Format F =
+          Blob.size() >= 2 && memcmp(Blob.data(), "\x1f\x8b", 2) == 0
+              ? llvm::compression::Format::Zlib
----------------
tschuett wrote:
> Could you put the magic number into a named constant?
& perhaps we should have/test a magic number for zstd too, so it's clear it's 
one or the other and not something else added in the future (since this isn't 
reving the bitcode version or anything - reading zstd compressed data with the 
library before this version will I guess/hopefully appear corrupted, but we 
could avoid that being the failure mode in the future when another compression 
scheme is added by checking explicitly for zstd/zlib now and reporting unknown 
compression scheme otherwise?)?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D137885

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to