r183355 - If we're splitting the dwarf for fission and don't want to use the

Eric Christopher echristo at gmail.com
Wed Jun 5 16:58:15 PDT 2013


Author: echristo
Date: Wed Jun  5 18:58:15 2013
New Revision: 183355

URL: http://llvm.org/viewvc/llvm-project?rev=183355&view=rev
Log:
If we're splitting the dwarf for fission and don't want to use the
integrated assembler then go ahead and still split the dwarf anyhow.

Add two tests, one to exercise existing behavior of not splitting
when we're just emitting assembly files and the other to test
that we split when we're not in integrated as mode.

Modified:
    cfe/trunk/lib/Driver/Tools.cpp
    cfe/trunk/test/Driver/split-debug.c

Modified: cfe/trunk/lib/Driver/Tools.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=183355&r1=183354&r2=183355&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Tools.cpp (original)
+++ cfe/trunk/lib/Driver/Tools.cpp Wed Jun  5 18:58:15 2013
@@ -5887,6 +5887,14 @@ void gnutools::Assemble::ConstructJob(Co
   const char *Exec =
     Args.MakeArgString(getToolChain().GetProgramPath("as"));
   C.addCommand(new Command(JA, *this, Exec, CmdArgs));
+
+  // 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().getOS() == llvm::Triple::Linux))
+    SplitDebugInfo(getToolChain(), C, *this, JA, Args, Output,
+                   SplitDebugName(Args, Inputs));
 }
 
 static void AddLibgcc(llvm::Triple Triple, const Driver &D,

Modified: cfe/trunk/test/Driver/split-debug.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/split-debug.c?rev=183355&r1=183354&r2=183355&view=diff
==============================================================================
--- cfe/trunk/test/Driver/split-debug.c (original)
+++ cfe/trunk/test/Driver/split-debug.c Wed Jun  5 18:58:15 2013
@@ -23,3 +23,13 @@
 // RUN: FileCheck -check-prefix=CHECK-OPTION < %t %s
 //
 // CHECK-OPTION: "-split-dwarf-file" "split-debug.dwo"
+
+// RUN: %clang -target x86_64-unknown-linux-gnu -gsplit-dwarf -S -### %s 2> %t
+// RUN: FileCheck -check-prefix=CHECK-ASM < %t %s
+//
+// CHECK-ASM-NOT: objcopy
+
+// RUN: %clang -target x86_64-unknown-linux-gnu -no-integrated-as -gsplit-dwarf -c -### %s 2> %t
+// RUN: FileCheck -check-prefix=CHECK-IAS < %t %s
+//
+// CHECK-IAS: objcopy





More information about the cfe-commits mailing list