r175851 - Make sure we only use the output file as a base for debug splitting

Eric Christopher echristo at gmail.com
Thu Feb 21 17:33:47 PST 2013


Author: echristo
Date: Thu Feb 21 19:33:46 2013
New Revision: 175851

URL: http://llvm.org/viewvc/llvm-project?rev=175851&view=rev
Log:
Make sure we only use the output file as a base for debug splitting
if we're compiling.

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=175851&r1=175850&r2=175851&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Tools.cpp (original)
+++ cfe/trunk/lib/Driver/Tools.cpp Thu Feb 21 19:33:46 2013
@@ -1723,7 +1723,7 @@ void Clang::SplitDebugInfo(Compilation &
   // Add an output for the extract.
   Arg *FinalOutput = C.getArgs().getLastArg(options::OPT_o);
   const char *OutFile;
-  if (FinalOutput) {
+  if (FinalOutput && C.getArgs().hasArg(options::OPT_c)) {
     SmallString<128> T(FinalOutput->getValue());
     llvm::sys::path::replace_extension(T, "dwo");
     OutFile = Args.MakeArgString(T);

Modified: cfe/trunk/test/Driver/split-debug.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/split-debug.c?rev=175851&r1=175850&r2=175851&view=diff
==============================================================================
--- cfe/trunk/test/Driver/split-debug.c (original)
+++ cfe/trunk/test/Driver/split-debug.c Thu Feb 21 19:33:46 2013
@@ -12,3 +12,9 @@
 // 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