From: Yaron Keren Date: Sun, 4 Jan 2015 13:48:30 +0000 (+0000) Subject: Fix default image name to 'a.exe' on Windows, instead 'a.out'. X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7c91552cd927fd998266cfcce21a37cc4dcfab91;p=platform%2Fupstream%2Fllvm.git Fix default image name to 'a.exe' on Windows, instead 'a.out'. This applies to mingw as clang-cl already has its own logic for the filename. llvm-svn: 225134 --- diff --git a/clang/include/clang/Driver/Driver.h b/clang/include/clang/Driver/Driver.h index 020966f..20ca5f0 100644 --- a/clang/include/clang/Driver/Driver.h +++ b/clang/include/clang/Driver/Driver.h @@ -105,7 +105,7 @@ public: std::string DefaultTargetTriple; /// Default name for linked images (e.g., "a.out"). - std::string DefaultImageName; + mutable std::string DefaultImageName; /// Driver title to use with help. std::string DriverTitle; diff --git a/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp index 8475e20..38765f0 100644 --- a/clang/lib/Driver/Driver.cpp +++ b/clang/lib/Driver/Driver.cpp @@ -1996,6 +1996,8 @@ const ToolChain &Driver::getToolChain(const ArgList &Args, StringRef DarwinArchName) const { llvm::Triple Target = computeTargetTriple(DefaultTargetTriple, Args, DarwinArchName); + if (Target.isOSWindows()) + DefaultImageName = "a.exe"; ToolChain *&TC = ToolChains[Target.str()]; if (!TC) { diff --git a/clang/test/Driver/lto.c b/clang/test/Driver/lto.c index ec6b3f1..62300bd 100644 --- a/clang/test/Driver/lto.c +++ b/clang/test/Driver/lto.c @@ -16,7 +16,7 @@ // RUN: grep '"-o" ".*lto\.i" "-x" "c" ".*lto\.c"' %t.log // RUN: grep '"-o" ".*lto\.bc" .*".*lto\.i"' %t.log // RUN: grep '"-o" ".*lto\.o" .*".*lto\.bc"' %t.log -// RUN: grep '".*a.out" .*".*lto\.o"' %t.log +// RUN: grep '".*a\.\(out\|exe\)" .*".*lto\.o"' %t.log // RUN: %clang %s -flto -S -### 2> %t.log // RUN: grep '"-o" ".*lto\.s" "-x" "c" ".*lto\.c"' %t.log