diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2008-06-15 15:20:16 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2008-06-15 15:20:16 +0000 |
commit | aea2be2610f0f03e78b01ac4949af823d839173a (patch) | |
tree | f543840d079e4eab13d5ab3776b02588021ca768 /llvm/tools/llvm-ld/llvm-ld.cpp | |
parent | 2cc0abf260b4acb66535a386efe4cb8868e15da6 (diff) | |
download | bcm5719-llvm-aea2be2610f0f03e78b01ac4949af823d839173a.tar.gz bcm5719-llvm-aea2be2610f0f03e78b01ac4949af823d839173a.zip |
Add an "exe" suffix only if the output file has no suffix at all.
llvm-svn: 52289
Diffstat (limited to 'llvm/tools/llvm-ld/llvm-ld.cpp')
-rw-r--r-- | llvm/tools/llvm-ld/llvm-ld.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/llvm/tools/llvm-ld/llvm-ld.cpp b/llvm/tools/llvm-ld/llvm-ld.cpp index 0b8269c7f24..40265628ac0 100644 --- a/llvm/tools/llvm-ld/llvm-ld.cpp +++ b/llvm/tools/llvm-ld/llvm-ld.cpp @@ -532,15 +532,15 @@ int main(int argc, char **argv, char **envp) { #if defined(_WIN32) || defined(__CYGWIN__) if (!LinkAsLibrary) { - // Make sure the output executable has an "exe" suffix. + // Default to "a.exe" instead of "a.out". + if (OutputFilename.getNumOccurrences() == 0) + OutputFilename = "a.exe"; + + // If there is no suffix add an "exe" one. sys::Path ExeFile( OutputFilename ); - if (ExeFile.getSuffix() != "exe") { - if (OutputFilename == "a.out") { - OutputFilename = "a.exe"; - } else { - ExeFile.appendSuffix("exe"); - OutputFilename = ExeFile.toString(); - } + if (ExeFile.getSuffix() == "") { + ExeFile.appendSuffix("exe"); + OutputFilename = ExeFile.toString(); } } #endif |