[PATCH] D71400: [RFC] [MinGW] Implicitly add .exe suffix if not provided

Reid Kleckner via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Dec 12 10:41:50 PST 2019


rnk added inline comments.


================
Comment at: clang/lib/Driver/ToolChains/MinGW.cpp:164
+  const char *OutputFile = Output.getFilename();
+#ifdef _WIN32
+  if (!llvm::sys::path::filename(OutputFile).contains('.'))
----------------
Can you add what you wrote in the commit message as a comment here to explain the divergence in behavior based on the compiler's host OS? I can imagine that a future maintainer will try to make the code behave the same way regardless of host.


================
Comment at: clang/lib/Driver/ToolChains/MinGW.cpp:165
+#ifdef _WIN32
+  if (!llvm::sys::path::filename(OutputFile).contains('.'))
+    CmdArgs.push_back(Args.MakeArgString(Twine(OutputFile) + ".exe"));
----------------
I think this can be spelled `llvm::sys::path::has_extension`.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D71400/new/

https://reviews.llvm.org/D71400





More information about the cfe-commits mailing list