summaryrefslogtreecommitdiff
path: root/tools/llvm-ld
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2008-06-15 15:20:16 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2008-06-15 15:20:16 +0000
commit48cca1fd4636879460a9cbe2aff4875c073c4bd2 (patch)
tree8a3fef678883475d32d9f211106e9062fa14ae42 /tools/llvm-ld
parentfc19988bcbe6cfbe4668c50cd9689a711cc26cdd (diff)
downloadllvm-48cca1fd4636879460a9cbe2aff4875c073c4bd2.tar.gz
llvm-48cca1fd4636879460a9cbe2aff4875c073c4bd2.tar.bz2
llvm-48cca1fd4636879460a9cbe2aff4875c073c4bd2.tar.xz
Add an "exe" suffix only if the output file has no suffix at all.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52289 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/llvm-ld')
-rw-r--r--tools/llvm-ld/llvm-ld.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/tools/llvm-ld/llvm-ld.cpp b/tools/llvm-ld/llvm-ld.cpp
index 0b8269c7f2..40265628ac 100644
--- a/tools/llvm-ld/llvm-ld.cpp
+++ b/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