[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:
parent
a03e17d4d9
commit
d9b9a7f428
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue