From 1f62f57b37bdd40f877eff3a2b1e80f51c82249c Mon Sep 17 00:00:00 2001 From: Saleem Abdulrasool Date: Fri, 9 Jun 2017 00:40:19 +0000 Subject: sink DebugCompressionType into MC for exposing to clang This is a preparatory change to expose the debug compression style to clang. It requires exposing the enumeration and passing the actual value through to the backend from the frontend in actual value form rather than a boolean that selects the GNU style of debug info compression. Minor tweak to the ELF Object Writer to use a variable for re-used values. Add an assertion that debug information format is one of the two currently known types if debug information is being compressed. llvm-svn: 305038 --- llvm/tools/llvm-mc/llvm-mc.cpp | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) (limited to 'llvm/tools/llvm-mc') diff --git a/llvm/tools/llvm-mc/llvm-mc.cpp b/llvm/tools/llvm-mc/llvm-mc.cpp index 87efac2d33c..8782588dfdd 100644 --- a/llvm/tools/llvm-mc/llvm-mc.cpp +++ b/llvm/tools/llvm-mc/llvm-mc.cpp @@ -56,17 +56,15 @@ static cl::opt RelaxELFRel( "relax-relocations", cl::init(true), cl::desc("Emit R_X86_64_GOTPCRELX instead of R_X86_64_GOTPCREL")); -static cl::opt -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 (deprecated)"))); +static cl::opt CompressDebugSections( + "compress-debug-sections", cl::ValueOptional, + 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::GNU, "zlib-gnu", + "Use zlib-gnu compression (deprecated)"))); static cl::opt ShowInst("show-inst", cl::desc("Show internal instruction representation")); @@ -494,7 +492,7 @@ int main(int argc, char **argv) { MAI->setRelaxELFRelocations(RelaxELFRel); - if (CompressDebugSections != DebugCompressionType::DCT_None) { + if (CompressDebugSections != DebugCompressionType::None) { if (!zlib::isAvailable()) { errs() << ProgName << ": build tools with zlib to enable -compress-debug-sections"; -- cgit v1.2.3