]> granicus.if.org Git - clang/commitdiff
If we're splitting the dwarf for fission and don't want to use the
authorEric Christopher <echristo@gmail.com>
Wed, 5 Jun 2013 23:58:15 +0000 (23:58 +0000)
committerEric Christopher <echristo@gmail.com>
Wed, 5 Jun 2013 23:58:15 +0000 (23:58 +0000)
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183355 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Driver/Tools.cpp
test/Driver/split-debug.c

index e95d49dd49033ad2b239c71379ce23ef65dbdd5a..8e670dbf0a3d67c4e013c61797f8a5eebf81be17 100644 (file)
@@ -5887,6 +5887,14 @@ void gnutools::Assemble::ConstructJob(Compilation &C, const JobAction &JA,
   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,
index d8a9fe841e275f02ad8b75d8c569dd02058dd92b..792abbd55259ef4a50639fedc4c6d3d6874faad1 100644 (file)
 // 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