[PATCH] D100361: [Driver] Make the findVCToolChainViaEnvironment case-insensitive
Artur Gainullin via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Apr 12 22:28:10 PDT 2021
ArturGainullin created this revision.
ArturGainullin added reviewers: rnk, hamzasood.
ArturGainullin requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.
PATH usage on Windows is case-insensitive. There could be situations
when toolchain path can't be obtained from PATH because of
case-sensitivity of the findVCToolChainViaEnvironment.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D100361
Files:
clang/lib/Driver/ToolChains/MSVC.cpp
Index: clang/lib/Driver/ToolChains/MSVC.cpp
===================================================================
--- clang/lib/Driver/ToolChains/MSVC.cpp
+++ clang/lib/Driver/ToolChains/MSVC.cpp
@@ -190,13 +190,15 @@
if (IsBin) {
llvm::StringRef ParentPath = llvm::sys::path::parent_path(TestPath);
llvm::StringRef ParentFilename = llvm::sys::path::filename(ParentPath);
- if (ParentFilename == "VC") {
+ if (ParentFilename.equals_lower("VC")) {
Path = std::string(ParentPath);
VSLayout = MSVCToolChain::ToolsetLayout::OlderVS;
return true;
}
- if (ParentFilename == "x86ret" || ParentFilename == "x86chk"
- || ParentFilename == "amd64ret" || ParentFilename == "amd64chk") {
+ if (ParentFilename.equals_lower("x86ret") ||
+ ParentFilename.equals_lower("x86chk") ||
+ ParentFilename.equals_lower("amd64ret") ||
+ ParentFilename.equals_lower("amd64chk")) {
Path = std::string(ParentPath);
VSLayout = MSVCToolChain::ToolsetLayout::DevDivInternal;
return true;
@@ -215,7 +217,7 @@
for (llvm::StringRef Prefix : ExpectedPrefixes) {
if (It == End)
goto NotAToolChain;
- if (!It->startswith(Prefix))
+ if (!It->startswith_lower(Prefix))
goto NotAToolChain;
++It;
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D100361.337046.patch
Type: text/x-patch
Size: 1411 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210413/1af61f65/attachment.bin>
More information about the cfe-commits
mailing list