[PATCH] D120115: [clangd] Tweak --query-driver to ignore slash direction on windows
Sam McCall via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Feb 18 09:06:43 PST 2022
This revision was automatically updated to reflect the committed changes.
Closed by commit rG47b749e5be21: [clangd] Tweak --query-driver to ignore slash direction on windows (authored by sammccall).
Changed prior to commit:
https://reviews.llvm.org/D120115?vs=409900&id=409957#toc
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D120115/new/
https://reviews.llvm.org/D120115
Files:
clang-tools-extra/clangd/QueryDriverDatabase.cpp
Index: clang-tools-extra/clangd/QueryDriverDatabase.cpp
===================================================================
--- clang-tools-extra/clangd/QueryDriverDatabase.cpp
+++ clang-tools-extra/clangd/QueryDriverDatabase.cpp
@@ -38,12 +38,10 @@
#include "clang/Basic/TargetOptions.h"
#include "clang/Driver/Types.h"
#include "clang/Tooling/CompilationDatabase.h"
-#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/ScopeExit.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/ADT/StringRef.h"
-#include "llvm/ADT/iterator_range.h"
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/MemoryBuffer.h"
#include "llvm/Support/Path.h"
@@ -276,6 +274,10 @@
// Single star, accept any sequence without a slash.
RegStream << "[^/]*";
}
+ } else if (llvm::sys::path::is_separator(Glob[I]) &&
+ llvm::sys::path::is_separator('/') &&
+ llvm::sys::path::is_separator('\\')) {
+ RegStream << R"([/\\])"; // Accept either slash on windows.
} else {
RegStream << llvm::Regex::escape(Glob.substr(I, 1));
}
@@ -293,6 +295,7 @@
for (llvm::StringRef Glob : Globs)
RegTexts.push_back(convertGlobToRegex(Glob));
+ // Tempting to pass IgnoreCase, but we don't know the FS sensitivity.
llvm::Regex Reg(llvm::join(RegTexts, "|"));
assert(Reg.isValid(RegTexts.front()) &&
"Created an invalid regex from globs");
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D120115.409957.patch
Type: text/x-patch
Size: 1450 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220218/5cf5f2e8/attachment.bin>
More information about the cfe-commits
mailing list