aboutsummaryrefslogtreecommitdiff
path: root/contrib/llvm-project/clang/lib/Tooling/JSONCompilationDatabase.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2022-03-20 11:40:34 +0000
committerDimitry Andric <dim@FreeBSD.org>2022-05-14 11:43:05 +0000
commit349cc55c9796c4596a5b9904cd3281af295f878f (patch)
tree410c5a785075730a35f1272ca6a7adf72222ad03 /contrib/llvm-project/clang/lib/Tooling/JSONCompilationDatabase.cpp
parentcb2ae6163174b90e999326ecec3699ee093a5d43 (diff)
parentc0981da47d5696fe36474fcf86b4ce03ae3ff818 (diff)
Diffstat (limited to 'contrib/llvm-project/clang/lib/Tooling/JSONCompilationDatabase.cpp')
-rw-r--r--contrib/llvm-project/clang/lib/Tooling/JSONCompilationDatabase.cpp13
1 files changed, 5 insertions, 8 deletions
diff --git a/contrib/llvm-project/clang/lib/Tooling/JSONCompilationDatabase.cpp b/contrib/llvm-project/clang/lib/Tooling/JSONCompilationDatabase.cpp
index 97ba7e411fbb..5e18d7a576c0 100644
--- a/contrib/llvm-project/clang/lib/Tooling/JSONCompilationDatabase.cpp
+++ b/contrib/llvm-project/clang/lib/Tooling/JSONCompilationDatabase.cpp
@@ -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) {