]> granicus.if.org Git - clang/commitdiff
Fix default image name to 'a.exe' on Windows, instead 'a.out'.
authorYaron Keren <yaron.keren@gmail.com>
Sun, 4 Jan 2015 13:48:30 +0000 (13:48 +0000)
committerYaron Keren <yaron.keren@gmail.com>
Sun, 4 Jan 2015 13:48:30 +0000 (13:48 +0000)
This applies to mingw as clang-cl already has its own logic for the filename.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@225134 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Driver/Driver.h
lib/Driver/Driver.cpp
test/Driver/lto.c

index 020966f8cd5940e2370acb234b7b85d68e13d2e9..20ca5f0dca036e21d7afb9458b605fd75b2d4b9c 100644 (file)
@@ -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;
index 8475e20cedbafb03dff7153fa88ee3bdf614dc4c..38765f00f1236de6ec6c01e1dbb81f566762eb88 100644 (file)
@@ -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) {
index ec6b3f1162df9b38f4cbb2429b242477c058956f..62300bd8fac1484e6bd89ab5d8075e6aa09c8b3f 100644 (file)
@@ -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