[PATCH] D20676: [llvm-mc] - Teach llvm-mc to generate zlib styled compression sections.

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Thu May 26 05:53:54 PDT 2016


grimar added inline comments.

================
Comment at: lib/CodeGen/LLVMTargetMachine.cpp:74
@@ -73,3 +73,3 @@
   if (Options.CompressDebugSections)
-    TmpAsmInfo->setCompressDebugSections(true);
+    TmpAsmInfo->setCompressDebugSections(DebugCompressionType::DCT_Zlib);
 
----------------
rafael wrote:
> I think in the first patch you will have to default to zlib-gnu. The reason is that right now there would be no way for someone using clang to set which one to use.
> 
> Once this patch is in with zlib-gnu as the default, we can teach TargetMachine and clang about the two types and change the default.
Ok. I started with it, but switched to the zlib here at last second. Just because previous patch has compression on/off only and had zlib as default.
Will switch back.

================
Comment at: tools/llvm-mc/llvm-mc.cpp:412
@@ -409,2 +411,3 @@
 
-  if (CompressDebugSections) {
+  DebugCompressionType Compression;
+  if (CompressDebugSections == "" || CompressDebugSections == "zlib" ||
----------------
rafael wrote:
> llvm-mc doesn't need to be command line compatible with as, so please simplify this.
> The option can be a cl::opt over an enum  with just 3 values: none, zlib, zlib-gnu.
> 
> See FileType for a similar option.
Yep, that what I did at first (see my comment above), but I thought command line compatibility is important, so had to do that.
I am happy to simplify this to enum parse way.


http://reviews.llvm.org/D20676





More information about the llvm-commits mailing list