[PATCH] D87673: [clangd] Don't use zlib when it's unavailable.

Aleksandr Platonov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 16 01:06:22 PDT 2020


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGd427df6369f1: [clangd] Don't use zlib when it's unavailable. (authored by ArcsinX).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D87673

Files:
  clang-tools-extra/clangd/index/Serialization.cpp


Index: clang-tools-extra/clangd/index/Serialization.cpp
===================================================================
--- clang-tools-extra/clangd/index/Serialization.cpp
+++ clang-tools-extra/clangd/index/Serialization.cpp
@@ -201,12 +201,13 @@
   llvm::SmallString<1> UncompressedStorage;
   if (UncompressedSize == 0) // No compression
     Uncompressed = R.rest();
-  else {
+  else if (llvm::zlib::isAvailable()) {
     if (llvm::Error E = llvm::zlib::uncompress(R.rest(), UncompressedStorage,
                                                UncompressedSize))
       return std::move(E);
     Uncompressed = UncompressedStorage;
-  }
+  } else
+    return error("Compressed string table, but zlib is unavailable");
 
   StringTableIn Table;
   llvm::StringSaver Saver(Table.Arena);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D87673.292129.patch
Type: text/x-patch
Size: 794 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200916/04a58e41/attachment.bin>


More information about the cfe-commits mailing list