diff options
author | Fangrui Song <i@maskray.me> | 2022-09-08 00:58:54 -0700 |
---|---|---|
committer | Fangrui Song <i@maskray.me> | 2022-09-08 00:58:55 -0700 |
commit | a41977dd0f4fd7aaad5ec380d50782296a690b47 (patch) | |
tree | f387eb917d2aec30288ec3c5fa73944cf995b2e7 /llvm/lib/Bitcode/Reader/BitcodeReader.cpp | |
parent | fd2475049e882e6c70a745cbe0799749ba184910 (diff) | |
download | llvm-a41977dd0f4fd7aaad5ec380d50782296a690b47.zip llvm-a41977dd0f4fd7aaad5ec380d50782296a690b47.tar.gz llvm-a41977dd0f4fd7aaad5ec380d50782296a690b47.tar.bz2 |
[Support] Add llvm::compression::{getReasonIfUnsupported,compress,decompress}
as high-level API on top of `llvm::compression::{zlib,zstd}::*`:
* getReasonIfUnsupported: return nullptr if the specified format is
supported, or (if unsupported) a string like `LLVM was not built with LLVM_ENABLE_ZLIB ...`
* compress: dispatch to zlib::uncompress or zstd::uncompress
* decompress: dispatch to zlib::uncompress or zstd::uncompress
Move `llvm::DebugCompressionType` from MC to Support to avoid Support->MC cyclic
dependency. There are 40+ uses in llvm-project.
Add another enum class `llvm::compression::Format` to represent supported
compression formats, which may be a superset of ELF compression formats.
See D130458 (llvm-objcopy --{,de}compress-debug-sections for zstd) for a use
case.
Link: https://discourse.llvm.org/t/rfc-zstandard-as-a-second-compression-method-to-llvm/63399
("[RFC] Zstandard as a second compression method to LLVM")
---
Note: this patch alone will cause -Wswitch to llvm/lib/ObjCopy/ELF/ELFObject.cpp
Reviewed By: ckissane, dblaikie
Differential Revision: https://reviews.llvm.org/D130506
Diffstat (limited to 'llvm/lib/Bitcode/Reader/BitcodeReader.cpp')
0 files changed, 0 insertions, 0 deletions