Make -save-temps=obj play better with -o.
Use only the *dirname* of the pathname given to -o, so that -o can still be used
to name the output executable. This is more like what GCC 4.5 does.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74790 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CompilerDriver/Main.cpp b/lib/CompilerDriver/Main.cpp
index c9c0413..7d1a3d8 100644
--- a/lib/CompilerDriver/Main.cpp
+++ b/lib/CompilerDriver/Main.cpp
@@ -37,6 +37,7 @@
}
else if (SaveTemps == SaveTempsEnum::Obj && !OutputFilename.empty()) {
tempDir = OutputFilename;
+ tempDir = tempDir.getDirname();
if (!tempDir.exists()) {
std::string ErrMsg;