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.

llvm-svn: 74790
This commit is contained in:
Mikhail Glushenkov 2009-07-04 14:23:32 +00:00
parent 9297a52715
commit 4f0fa1539c
2 changed files with 2 additions and 1 deletions

View File

@ -37,6 +37,7 @@ namespace {
}
else if (SaveTemps == SaveTempsEnum::Obj && !OutputFilename.empty()) {
tempDir = OutputFilename;
tempDir = tempDir.getDirname();
if (!tempDir.exists()) {
std::string ErrMsg;

View File

@ -56,7 +56,7 @@ sys::Path Tool::OutFilename(const sys::Path& In,
sys::Path Out;
if (StopCompilation) {
if (!OutputFilename.empty() && SaveTemps != SaveTempsEnum::Obj ) {
if (!OutputFilename.empty()) {
Out.set(OutputFilename);
}
else if (IsJoin()) {