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
This commit is contained in:
Argyrios Kyrtzidis 2008-06-15 15:20:16 +00:00
parent fc19988bcb
commit 48cca1fd46

View File

@ -532,17 +532,17 @@ int main(int argc, char **argv, char **envp) {
#if defined(_WIN32) || defined(__CYGWIN__)
if (!LinkAsLibrary) {
// Make sure the output executable has an "exe" suffix.
sys::Path ExeFile( OutputFilename );
if (ExeFile.getSuffix() != "exe") {
if (OutputFilename == "a.out") {
// Default to "a.exe" instead of "a.out".
if (OutputFilename.getNumOccurrences() == 0)
OutputFilename = "a.exe";
} else {
// If there is no suffix add an "exe" one.
sys::Path ExeFile( OutputFilename );
if (ExeFile.getSuffix() == "") {
ExeFile.appendSuffix("exe");
OutputFilename = ExeFile.toString();
}
}
}
#endif
// Generate the bitcode for the optimized module.