[PATCH] D111195: [clang][Tooling] Use Windows command lines on all Windows, except Cygwin

Jeremy Drake via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 6 10:13:56 PDT 2021


jeremyd2019 updated this revision to Diff 377590.
jeremyd2019 added a comment.

Switched to #ifdef _WIN32 instead of checking triple


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

https://reviews.llvm.org/D111195

Files:
  clang/lib/Tooling/JSONCompilationDatabase.cpp


Index: clang/lib/Tooling/JSONCompilationDatabase.cpp
===================================================================
--- clang/lib/Tooling/JSONCompilationDatabase.cpp
+++ clang/lib/Tooling/JSONCompilationDatabase.cpp
@@ -135,15 +135,12 @@
 std::vector<std::string> unescapeCommandLine(JSONCommandLineSyntax Syntax,
                                              StringRef EscapedCommandLine) {
   if (Syntax == JSONCommandLineSyntax::AutoDetect) {
+#ifdef _WIN32
+    // Assume Windows command line parsing on Win32
+    Syntax = JSONCommandLineSyntax::Windows;
+#else
     Syntax = JSONCommandLineSyntax::Gnu;
-    llvm::Triple Triple(llvm::sys::getProcessTriple());
-    if (Triple.getOS() == llvm::Triple::OSType::Win32) {
-      // Assume Windows command line parsing on Win32 unless the triple
-      // explicitly tells us otherwise.
-      if (!Triple.hasEnvironment() ||
-          Triple.getEnvironment() == llvm::Triple::EnvironmentType::MSVC)
-        Syntax = JSONCommandLineSyntax::Windows;
-    }
+#endif
   }
 
   if (Syntax == JSONCommandLineSyntax::Windows) {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D111195.377590.patch
Type: text/x-patch
Size: 1080 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20211006/dd8e45e8/attachment.bin>


More information about the cfe-commits mailing list