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

Previously it only used Windows command lines for MSVC triples, but this
was causing issues for windows-gnu.  In fact, everything 'native' Windows
(ie, not Cygwin) should use Windows command line parsing.

Reviewed By: mstorsjo

Differential Revision: https://reviews.llvm.org/D111195
This commit is contained in:
Jeremy Drake 2021-10-13 22:49:29 +03:00 committed by Martin Storsjö
parent a03e17d4d9
commit d9b9a7f428

View file

@ -135,15 +135,12 @@ class CommandLineArgumentParser {
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) {