From 7413d224f525a7e89954ab0c85cf607780133a65 Mon Sep 17 00:00:00 2001 From: Zachary Turner Date: Thu, 18 Aug 2016 19:42:00 +0000 Subject: [PATCH] Fix json compilation database syntax on non-Windows. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@279122 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Tooling/JSONCompilationDatabase.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/Tooling/JSONCompilationDatabase.cpp b/lib/Tooling/JSONCompilationDatabase.cpp index 07292da6b3..152508fb7d 100644 --- a/lib/Tooling/JSONCompilationDatabase.cpp +++ b/lib/Tooling/JSONCompilationDatabase.cpp @@ -117,16 +117,14 @@ class CommandLineArgumentParser { std::vector 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; } } -- 2.40.0