[PATCH] Allow -gsplit-dwarf for all ELF targets, not just Linux

Ed Maste emaste at freebsd.org
Fri Mar 20 09:06:58 PDT 2015


Hi echristo,

http://reviews.llvm.org/D8484

Files:
  lib/Driver/Tools.cpp

Index: lib/Driver/Tools.cpp
===================================================================
--- lib/Driver/Tools.cpp
+++ lib/Driver/Tools.cpp
@@ -3296,8 +3296,7 @@
   // FIXME: Move backend command line options to the module.
   // -gsplit-dwarf should turn on -g and enable the backend dwarf
   // splitting and extraction.
-  // FIXME: Currently only works on Linux.
-  if (getToolChain().getTriple().isOSLinux() &&
+  if (getToolChain().getTriple().isOSBinFormatELF() &&
       Args.hasArg(options::OPT_gsplit_dwarf)) {
     CmdArgs.push_back("-g");
     CmdArgs.push_back("-backend-option");
@@ -4616,7 +4615,7 @@
   // Add the split debug info name to the command lines here so we
   // can propagate it to the backend.
   bool SplitDwarf = Args.hasArg(options::OPT_gsplit_dwarf) &&
-    getToolChain().getTriple().isOSLinux() &&
+    getToolChain().getTriple().isOSBinFormatELF() &&
     (isa<AssembleJobAction>(JA) || isa<CompileJobAction>(JA) ||
      isa<BackendJobAction>(JA));
   const char *SplitDwarfOut;
@@ -5115,9 +5114,8 @@
 
   // Handle the debug info splitting at object creation time if we're
   // creating an object.
-  // TODO: Currently only works on linux with newer objcopy.
   if (Args.hasArg(options::OPT_gsplit_dwarf) &&
-      getToolChain().getTriple().isOSLinux())
+      getToolChain().getTriple().isOSBinFormatELF())
     SplitDebugInfo(getToolChain(), C, *this, JA, Args, Output,
                    SplitDebugName(Args, Inputs));
 }
@@ -7420,9 +7418,8 @@
 
   // Handle the debug info splitting at object creation time if we're
   // creating an object.
-  // TODO: Currently only works on linux with newer objcopy.
   if (Args.hasArg(options::OPT_gsplit_dwarf) &&
-      getToolChain().getTriple().isOSLinux())
+      getToolChain().getTriple().isOSBinFormatELF())
     SplitDebugInfo(getToolChain(), C, *this, JA, Args, Output,
                    SplitDebugName(Args, Inputs));
 }

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D8484.22353.patch
Type: text/x-patch
Size: 1924 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20150320/4eb64c51/attachment.bin>


More information about the cfe-commits mailing list