[llvm-commits] [llvm] r52285 - /llvm/trunk/tools/llvm-ld/llvm-ld.cpp
Argiris Kirtzidis
akyrtzi at gmail.com
Sun Jun 15 05:01:19 PDT 2008
Author: akirtzidis
Date: Sun Jun 15 07:01:16 2008
New Revision: 52285
URL: http://llvm.org/viewvc/llvm-project?rev=52285&view=rev
Log:
Append "exe" suffix to executable files.
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=52285&r1=52284&r2=52285&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-ld/llvm-ld.cpp (original)
+++ llvm/trunk/tools/llvm-ld/llvm-ld.cpp Sun Jun 15 07:01:16 2008
@@ -403,7 +403,11 @@
if (llvmstub.isEmpty())
PrintAndExit("Could not find llvm-stub.exe executable!");
- if (0 != sys::CopyFile(sys::Path(OutputFilename), llvmstub, &ErrMsg))
+ sys::Path OutPath(OutputFilename);
+ if (OutPath.getSuffix() != "exe")
+ OutPath.appendSuffix("exe");
+
+ if (0 != sys::CopyFile(OutPath, llvmstub, &ErrMsg))
PrintAndExit(ErrMsg);
return;
@@ -532,6 +536,12 @@
// Generate the bitcode for the optimized module.
std::string RealBitcodeOutput = OutputFilename;
+
+#if defined(_WIN32) || defined(__CYGWIN__)
+ if (!LinkAsLibrary && sys::Path(OutputFilename).getSuffix() != "exe")
+ RealBitcodeOutput += ".exe";
+#endif
+
if (!LinkAsLibrary) RealBitcodeOutput += ".bc";
GenerateBitcode(Composite.get(), RealBitcodeOutput);
More information about the llvm-commits
mailing list