diff options
| author | George Rimar <grimar@accesssoftek.com> | 2016-05-27 09:58:08 +0000 |
|---|---|---|
| committer | George Rimar <grimar@accesssoftek.com> | 2016-05-27 09:58:08 +0000 |
| commit | 48dcd2b8061e433a0a7406cbf2a93e0ef4e45541 (patch) | |
| tree | 5f9c6c87bbc4cef0362d35ced0589be0aeed7f15 /llvm/tools/llvm-mc | |
| parent | 4642a57fbfda606d6af3da4f0ee5c17c96cfcce5 (diff) | |
| download | bcm5719-llvm-48dcd2b8061e433a0a7406cbf2a93e0ef4e45541.tar.gz bcm5719-llvm-48dcd2b8061e433a0a7406cbf2a93e0ef4e45541.zip | |
[llvm-mc] - Teach llvm-mc to generate zlib styled compression sections.
This patch is strongly based on previously reverted D20331.
(because of gnuutils < 2.26 does not support compressed debug sections in non zlib-gnu style)
Difference that this patch supports both zlib and zlib-gnu styles.
-compress-debug-sections option now supports next values:
-compress-debug-sections=zlib-gnu
-compress-debug-sections=zlib
-compress-debug-sections=none
Previously specifying -compress-debug-sections enabled zlib-gnu compression,
so anyone can put "-compress-debug-sections=zlib-gnu" to restore the behavior
that was before this patch for case when compression was enabled.
Differential revision: http://reviews.llvm.org/D20676
llvm-svn: 270977
Diffstat (limited to 'llvm/tools/llvm-mc')
| -rw-r--r-- | llvm/tools/llvm-mc/llvm-mc.cpp | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/llvm/tools/llvm-mc/llvm-mc.cpp b/llvm/tools/llvm-mc/llvm-mc.cpp index 9ea8f2ef433..d9e3798ee88 100644 --- a/llvm/tools/llvm-mc/llvm-mc.cpp +++ b/llvm/tools/llvm-mc/llvm-mc.cpp @@ -52,9 +52,18 @@ OutputFilename("o", cl::desc("Output filename"), static cl::opt<bool> ShowEncoding("show-encoding", cl::desc("Show instruction encodings")); -static cl::opt<bool> -CompressDebugSections("compress-debug-sections", - cl::desc("Compress DWARF debug sections")); +static cl::opt<DebugCompressionType> +CompressDebugSections("compress-debug-sections", cl::ValueOptional, + cl::init(DebugCompressionType::DCT_None), + cl::desc("Choose DWARF debug sections compression:"), + cl::values( + clEnumValN(DebugCompressionType::DCT_None, "none", + "No compression"), + clEnumValN(DebugCompressionType::DCT_Zlib, "zlib", + "Use zlib compression"), + clEnumValN(DebugCompressionType::DCT_ZlibGnu, "zlib-gnu", + "Use zlib-gnu compression (depricated)"), + clEnumValEnd)); static cl::opt<bool> ShowInst("show-inst", cl::desc("Show internal instruction representation")); @@ -407,13 +416,13 @@ int main(int argc, char **argv) { std::unique_ptr<MCAsmInfo> MAI(TheTarget->createMCAsmInfo(*MRI, TripleName)); assert(MAI && "Unable to create target asm info!"); - if (CompressDebugSections) { + if (CompressDebugSections != DebugCompressionType::DCT_None) { if (!zlib::isAvailable()) { errs() << ProgName << ": build tools with zlib to enable -compress-debug-sections"; return 1; } - MAI->setCompressDebugSections(true); + MAI->setCompressDebugSections(CompressDebugSections); } // FIXME: This is not pretty. MCContext has a ptr to MCObjectFileInfo and |

