[PATCH] D130516: compression classes

Cole Kissane via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 27 15:10:06 PDT 2022


ckissane added inline comments.


================
Comment at: clang-tools-extra/clangd/index/Serialization.cpp:32
+llvm::compression::CompressionAlgorithm *StringTableCompressionScheme =
+    new llvm::compression::ZlibCompressionAlgorithm();
+
----------------
dblaikie wrote:
> We're generally trying to avoid global ctors in LLVM. So at most this should be a static local variable in a function that accesses the algorithm (though perhaps these "compression algorithm" classes shouldn't be accessible directly, and only through singleton accessors in the defined alongside - like there's no reason for LLVM to contain more than one instance of ZlibCompressionAlgorithm, I think?)
your idea seems correct to me, however
some algorithms, such as zstd, support running in multiple threads, so this might influence our decision.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D130516



More information about the llvm-commits mailing list