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.
Note: this patch alone will cause -Wswitch to llvm/lib/ObjCopy/ELF/ELFObject.cpp
If llvm::CompressionFormat (or possibly under llvm::compression) looks better, I'll also rename Z to Zlib.