================
@@ -1927,19 +1927,15 @@ bool ASTReader::ReadSLocEntry(int ID) {
     unsigned RecCode = MaybeRecCode.get();
 
     if (RecCode == SM_SLOC_BUFFER_BLOB_COMPRESSED) {
-      // Inspect the first byte to differentiate zlib (\x78) and zstd
-      // (little-endian 0xFD2FB528).
-      const llvm::compression::Format F =
-          Blob.size() > 0 && Blob.data()[0] == 0x78
-              ? llvm::compression::Format::Zlib
-              : llvm::compression::Format::Zstd;
-      if (const char *Reason = llvm::compression::getReasonIfUnsupported(F)) {
+      ArrayRef<uint8_t> Compressed = llvm::arrayRefFromStringRef(Blob);
+      if (const char *Reason =
+              llvm::compression::getReasonIfUnsupported(Compressed)) {
         Error(Reason);
         return nullptr;
       }
----------------
jhuber6 wrote:

Done, I did that just to keep the old flow, but we can definitely just pipe 
this through the `Error` instead of a `const char *`.

https://github.com/llvm/llvm-project/pull/222773
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to