From: Daniel Dunbar Date: Fri, 25 Mar 2011 18:16:51 +0000 (+0000) Subject: Driver/Darwin: Dsymutil actions should put the dSYM adjacent to the output file. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=59f9046031bc9703d405b5a9ec61541a90e03def;p=clang Driver/Darwin: Dsymutil actions should put the dSYM adjacent to the output file. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128292 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Driver/Driver.cpp b/lib/Driver/Driver.cpp index ef777149d7..9d02dee540 100644 --- a/lib/Driver/Driver.cpp +++ b/lib/Driver/Driver.cpp @@ -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(JA)) + BaseName = BasePath; + else + BaseName = llvm::sys::path::filename(BasePath); // Determine what the derived output name should be. const char *NamedOutput; diff --git a/test/Driver/darwin-dsymutil.c b/test/Driver/darwin-dsymutil.c index f1ffcdc589..afb41a9db2 100644 --- a/test/Driver/darwin-dsymutil.c +++ b/test/Driver/darwin-dsymutil.c @@ -36,3 +36,10 @@ // 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"