]> granicus.if.org Git - clang/commitdiff
Fix json compilation database syntax on non-Windows.
authorZachary Turner <zturner@google.com>
Thu, 18 Aug 2016 19:42:00 +0000 (19:42 +0000)
committerZachary Turner <zturner@google.com>
Thu, 18 Aug 2016 19:42:00 +0000 (19:42 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@279122 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Tooling/JSONCompilationDatabase.cpp

index 07292da6b3947aec21ab3eaf62a47bcb757027dd..152508fb7df126b1a1fb37bd99acb4134f887d0a 100644 (file)
@@ -117,16 +117,14 @@ class CommandLineArgumentParser {
 std::vector<std::string> unescapeCommandLine(JSONCommandLineSyntax Syntax,
                                              StringRef EscapedCommandLine) {
   if (Syntax == JSONCommandLineSyntax::AutoDetect) {
+    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.
+      // explicitly tells us otherwise.
       if (!Triple.hasEnvironment() ||
           Triple.getEnvironment() == llvm::Triple::EnvironmentType::MSVC)
         Syntax = JSONCommandLineSyntax::Windows;
-      else
-        Syntax = JSONCommandLineSyntax::Gnu;
     }
   }