[llvm-commits] [llvm] r52289 - /llvm/trunk/tools/llvm-ld/llvm-ld.cpp

Argiris Kirtzidis akyrtzi at gmail.com
Sun Jun 15 08:20:17 PDT 2008


Author: akirtzidis
Date: Sun Jun 15 10:20:16 2008
New Revision: 52289

URL: http://llvm.org/viewvc/llvm-project?rev=52289&view=rev
Log:
Add an "exe" suffix only if the output file has no suffix at all.

Modified:
    llvm/trunk/tools/llvm-ld/llvm-ld.cpp

Modified: llvm/trunk/tools/llvm-ld/llvm-ld.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-ld/llvm-ld.cpp?rev=52289&r1=52288&r2=52289&view=diff

==============================================================================
--- llvm/trunk/tools/llvm-ld/llvm-ld.cpp (original)
+++ llvm/trunk/tools/llvm-ld/llvm-ld.cpp Sun Jun 15 10:20:16 2008
@@ -532,15 +532,15 @@
 
 #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





More information about the llvm-commits mailing list