aboutsummaryrefslogtreecommitdiff
path: root/llvm/tools/llvm-mc/llvm-mc.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/tools/llvm-mc/llvm-mc.cpp')
-rw-r--r--llvm/tools/llvm-mc/llvm-mc.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/llvm/tools/llvm-mc/llvm-mc.cpp b/llvm/tools/llvm-mc/llvm-mc.cpp
index aa380d3fe9bc..dd5a66a6eb7d 100644
--- a/llvm/tools/llvm-mc/llvm-mc.cpp
+++ b/llvm/tools/llvm-mc/llvm-mc.cpp
@@ -76,8 +76,8 @@ static cl::opt<DebugCompressionType> CompressDebugSections(
cl::init(DebugCompressionType::None),
cl::desc("Choose DWARF debug sections compression:"),
cl::values(clEnumValN(DebugCompressionType::None, "none", "No compression"),
- clEnumValN(DebugCompressionType::Z, "zlib",
- "Use zlib compression")),
+ clEnumValN(DebugCompressionType::Zlib, "zlib", "Use zlib"),
+ clEnumValN(DebugCompressionType::Zstd, "zstd", "Use zstd")),
cl::cat(MCCategory));
static cl::opt<bool>
@@ -399,15 +399,15 @@ int main(int argc, char **argv) {
assert(MAI && "Unable to create target asm info!");
MAI->setRelaxELFRelocations(RelaxELFRel);
-
if (CompressDebugSections != DebugCompressionType::None) {
- if (!compression::zlib::isAvailable()) {
+ if (const char *Reason = compression::getReasonIfUnsupported(
+ compression::formatFor(CompressDebugSections))) {
WithColor::error(errs(), ProgName)
- << "build tools with zlib to enable -compress-debug-sections";
+ << "--compress-debug-sections: " << Reason;
return 1;
}
- MAI->setCompressDebugSections(CompressDebugSections);
}
+ MAI->setCompressDebugSections(CompressDebugSections);
MAI->setPreserveAsmComments(PreserveComments);
// Package up features to be passed to target/subtarget