diff options
author | Fangrui Song <i@maskray.me> | 2022-03-14 21:38:04 +0300 |
---|---|---|
committer | Fangrui Song <i@maskray.me> | 2022-03-14 21:38:04 +0300 |
commit | 407c721ceb93863b2cb3851a6aa7686f31657e6b (patch) | |
tree | bdd1fb182702b17b1e7553413be20a9d1c7abd6c /clang-tools-extra | |
parent | b0a76b016219fb6ff878eca5a986799506c98053 (diff) |
[Support] Change zlib::compress to return void
With a sufficiently large output buffer, the only failure is Z_MEM_ERROR.
Check it and call the noreturn report_bad_alloc_error if applicable.
resize_for_overwrite may call report_bad_alloc_error as well.
Now that there is no other error type, we can replace the return type with void
and simplify call sites.
Reviewed By: ikudrin
Differential Revision: https://reviews.llvm.org/D121512
Diffstat (limited to 'clang-tools-extra')
-rw-r--r-- | clang-tools-extra/clangd/index/Serialization.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clang-tools-extra/clangd/index/Serialization.cpp b/clang-tools-extra/clangd/index/Serialization.cpp index 8ceecb607236..f7045f0be3fd 100644 --- a/clang-tools-extra/clangd/index/Serialization.cpp +++ b/clang-tools-extra/clangd/index/Serialization.cpp @@ -192,7 +192,7 @@ public: } if (llvm::zlib::isAvailable()) { llvm::SmallString<1> Compressed; - llvm::cantFail(llvm::zlib::compress(RawTable, Compressed)); + llvm::zlib::compress(RawTable, Compressed); write32(RawTable.size(), OS); OS << Compressed; } else { |