From 0a0c4cc56f8bb143443894cb5053c418002587b9 Mon Sep 17 00:00:00 2001 From: David Blaikie Date: Thu, 27 Mar 2014 20:45:58 +0000 Subject: DebugInfo: Support for compressed debug info sections 1) When creating a .debug_* section and instead create a .zdebug_ section. 2) When creating a fragment in a .zdebug_* section, make it a compressed fragment. 3) When computing the size of a compressed section, compress the data and use the size of the compressed data. 4) Emit the compressed bytes. Also, check that only if a section has a compressed fragment, then that is the only fragment in the section. Assert-fail if the fragment's data is modified after it is compressed. Initial review on llvm-commits by Eric Christopher and Rafael Espindola. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204958 91177308-0d34-0410-b5e6-96231b3b80d8 --- tools/llvm-mc/llvm-mc.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'tools/llvm-mc') diff --git a/tools/llvm-mc/llvm-mc.cpp b/tools/llvm-mc/llvm-mc.cpp index a4b4a844f6..b2e7a81488 100644 --- a/tools/llvm-mc/llvm-mc.cpp +++ b/tools/llvm-mc/llvm-mc.cpp @@ -49,6 +49,9 @@ OutputFilename("o", cl::desc("Output filename"), static cl::opt ShowEncoding("show-encoding", cl::desc("Show instruction encodings")); +static cl::opt +CompressDebugSections("compress-debug-sections", cl::desc("Compress DWARF debug sections")); + static cl::opt ShowInst("show-inst", cl::desc("Show internal instruction representation")); @@ -381,6 +384,9 @@ int main(int argc, char **argv) { std::unique_ptr MAI(TheTarget->createMCAsmInfo(*MRI, TripleName)); assert(MAI && "Unable to create target asm info!"); + if (CompressDebugSections) + MAI->setCompressDebugSections(true); + // FIXME: This is not pretty. MCContext has a ptr to MCObjectFileInfo and // MCObjectFileInfo needs a MCContext reference in order to initialize itself. std::unique_ptr MOFI(new MCObjectFileInfo()); -- cgit v1.2.3