]> granicus.if.org Git - clang/commitdiff
Driver/Darwin: Dsymutil actions should put the dSYM adjacent to the output file.
authorDaniel Dunbar <daniel@zuster.org>
Fri, 25 Mar 2011 18:16:51 +0000 (18:16 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Fri, 25 Mar 2011 18:16:51 +0000 (18:16 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128292 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Driver/Driver.cpp
test/Driver/darwin-dsymutil.c

index ef777149d70433b628cfca0c642b702322e11460..9d02dee540e97249c5b6a7a250870c4b98d6c16d 100644 (file)
@@ -1226,7 +1226,13 @@ const char *Driver::GetNamedOutputPath(Compilation &C,
   }
 
   llvm::SmallString<128> BasePath(BaseInput);
-  llvm::StringRef BaseName = llvm::sys::path::filename(BasePath);
+  llvm::StringRef BaseName;
+
+  // Dsymutil actions should use the full path.
+  if (isa<DsymutilJobAction>(JA))
+    BaseName = BasePath;
+  else
+    BaseName = llvm::sys::path::filename(BasePath);
 
   // Determine what the derived output name should be.
   const char *NamedOutput;
index f1ffcdc589d40e1885df1f4258f5bc1e480456f1..afb41a9db28b1fbd5a1b47ec039d3f7bd0a57fd7 100644 (file)
 // RUN: %clang -ccc-host-triple x86_64-apple-darwin10 -ccc-print-bindings \
 // RUN:   -o foo %t.o -g 2> %t
 // RUN: grep "Dsymutil" %t | count 0
+
+// Check that we put the .dSYM in the right place.
+// RUN: %clang -ccc-host-triple x86_64-apple-darwin10 -ccc-print-bindings \
+// RUN:   -o bar/foo %s -g 2> %t
+// RUN: FileCheck -check-prefix=CHECK-LOCATION < %t %s
+
+// CHECK-LOCATION: "x86_64-apple-darwin10" - "darwin::Dsymutil", inputs: ["bar/foo"], output: "bar/foo.dSYM"