r225134 - Fix default image name to 'a.exe' on Windows, instead 'a.out'.
Yaron Keren
yaron.keren at gmail.com
Sun Jan 4 05:48:30 PST 2015
Author: yrnkrn
Date: Sun Jan 4 07:48:30 2015
New Revision: 225134
URL: http://llvm.org/viewvc/llvm-project?rev=225134&view=rev
Log:
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.
Modified:
cfe/trunk/include/clang/Driver/Driver.h
cfe/trunk/lib/Driver/Driver.cpp
cfe/trunk/test/Driver/lto.c
Modified: cfe/trunk/include/clang/Driver/Driver.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Driver/Driver.h?rev=225134&r1=225133&r2=225134&view=diff
==============================================================================
--- cfe/trunk/include/clang/Driver/Driver.h (original)
+++ cfe/trunk/include/clang/Driver/Driver.h Sun Jan 4 07:48:30 2015
@@ -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;
Modified: cfe/trunk/lib/Driver/Driver.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Driver.cpp?rev=225134&r1=225133&r2=225134&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Driver.cpp (original)
+++ cfe/trunk/lib/Driver/Driver.cpp Sun Jan 4 07:48:30 2015
@@ -1996,6 +1996,8 @@ const ToolChain &Driver::getToolChain(co
StringRef DarwinArchName) const {
llvm::Triple Target = computeTargetTriple(DefaultTargetTriple, Args,
DarwinArchName);
+ if (Target.isOSWindows())
+ DefaultImageName = "a.exe";
ToolChain *&TC = ToolChains[Target.str()];
if (!TC) {
Modified: cfe/trunk/test/Driver/lto.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/lto.c?rev=225134&r1=225133&r2=225134&view=diff
==============================================================================
--- cfe/trunk/test/Driver/lto.c (original)
+++ cfe/trunk/test/Driver/lto.c Sun Jan 4 07:48:30 2015
@@ -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
More information about the cfe-commits
mailing list