r179218 - For split dwarf we should also run the objcopy action if we're

Eric Christopher echristo at gmail.com
Wed Apr 10 14:30:40 PDT 2013


Author: echristo
Date: Wed Apr 10 16:30:40 2013
New Revision: 179218

URL: http://llvm.org/viewvc/llvm-project?rev=179218&view=rev
Log:
For split dwarf we should also run the objcopy action if we're
just assembling a file and have passed the option.

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

Modified: cfe/trunk/lib/Driver/Tools.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=179218&r1=179217&r2=179218&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Tools.cpp (original)
+++ cfe/trunk/lib/Driver/Tools.cpp Wed Apr 10 16:30:40 2013
@@ -3671,6 +3671,14 @@ void ClangAs::ConstructJob(Compilation &
 
   const char *Exec = getToolChain().getDriver().getClangProgramPath();
   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));
 }
 
 void gcc::Common::ConstructJob(Compilation &C, const JobAction &JA,

Added: cfe/trunk/test/Driver/split-debug.s
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/split-debug.s?rev=179218&view=auto
==============================================================================
--- cfe/trunk/test/Driver/split-debug.s (added)
+++ cfe/trunk/test/Driver/split-debug.s Wed Apr 10 16:30:40 2013
@@ -0,0 +1,21 @@
+// Check that we split debug output properly
+//
+// REQUIRES: asserts
+// RUN: %clang -target x86_64-unknown-linux-gnu -gsplit-dwarf -c -### %s 2> %t
+// RUN: FileCheck -check-prefix=CHECK-ACTIONS < %t %s
+//
+// CHECK-ACTIONS: objcopy{{.*}}--extract-dwo{{.*}}"split-debug.dwo"
+// CHECK-ACTIONS: objcopy{{.*}}--strip-dwo{{.*}}"split-debug.o"
+
+
+// RUN: %clang -target x86_64-macosx -gsplit-dwarf -c -### %s 2> %t
+// RUN: FileCheck -check-prefix=CHECK-NO-ACTIONS < %t %s
+//
+// CHECK-NO-ACTIONS-NOT: -split-dwarf
+
+
+// RUN: %clang -target x86_64-unknown-linux-gnu -gsplit-dwarf -o Bad.x -### %s 2> %t
+// RUN: FileCheck -check-prefix=CHECK-BAD < %t %s
+//
+// CHECK-BAD-NOT: "Bad.dwo"
+





More information about the cfe-commits mailing list