[clang] 5958dc7 - Try to fix clang/test/Driver/cl-include.c failure
Hans Wennborg via cfe-commits
cfe-commits at lists.llvm.org
Mon Jun 21 08:21:20 PDT 2021
Author: Hans Wennborg
Date: 2021-06-21T17:19:00+02:00
New Revision: 5958dc75ced482228ae4489df1eb5e255e04e5eb
URL: https://github.com/llvm/llvm-project/commit/5958dc75ced482228ae4489df1eb5e255e04e5eb
DIFF: https://github.com/llvm/llvm-project/commit/5958dc75ced482228ae4489df1eb5e255e04e5eb.diff
LOG: Try to fix clang/test/Driver/cl-include.c failure
Somewhat speculative. Example failures:
https://lab.llvm.org/buildbot/#/builders/5/builds/8857/steps/9/logs/stdio
https://lab.llvm.org/buildbot/#/builders/123/builds/4621/steps/8/logs/stdio
Added:
Modified:
clang/lib/Driver/ToolChains/MSVC.cpp
Removed:
################################################################################
diff --git a/clang/lib/Driver/ToolChains/MSVC.cpp b/clang/lib/Driver/ToolChains/MSVC.cpp
index 18543f313b2f..98cf0fff49b2 100644
--- a/clang/lib/Driver/ToolChains/MSVC.cpp
+++ b/clang/lib/Driver/ToolChains/MSVC.cpp
@@ -1244,8 +1244,8 @@ void MSVCToolChain::AddClangSystemIncludeArgs(const ArgList &DriverArgs,
addSystemInclude(DriverArgs, CC1Args, Path);
auto AddSystemIncludesFromEnv = [&](StringRef Var) -> bool {
- SmallVector<StringRef, 8> Dirs;
if (auto Val = llvm::sys::Process::GetEnv(Var)) {
+ SmallVector<StringRef, 8> Dirs;
StringRef(*Val).split(Dirs, ";", /*MaxSplit=*/-1, /*KeepEmpty=*/false);
if (!Dirs.empty()) {
addSystemIncludes(DriverArgs, CC1Args, Dirs);
@@ -1268,8 +1268,9 @@ void MSVCToolChain::AddClangSystemIncludeArgs(const ArgList &DriverArgs,
// paths set by vcvarsall.bat. Skip if the user expressly set a vctoolsdir.
if (!DriverArgs.getLastArg(options::OPT__SLASH_vctoolsdir,
options::OPT__SLASH_winsysroot)) {
- if (AddSystemIncludesFromEnv("INCLUDE") |
- AddSystemIncludesFromEnv("EXTERNAL_INCLUDE"))
+ bool Found = AddSystemIncludesFromEnv("INCLUDE");
+ Found |= AddSystemIncludesFromEnv("EXTERNAL_INCLUDE");
+ if (Found)
return;
}
@@ -1292,7 +1293,7 @@ void MSVCToolChain::AddClangSystemIncludeArgs(const ArgList &DriverArgs,
}
std::string WindowsSDKDir;
- int major;
+ int major = 0;
std::string windowsSDKIncludeVersion;
std::string windowsSDKLibVersion;
if (getWindowsSDKDir(getVFS(), DriverArgs, WindowsSDKDir, major,
More information about the cfe-commits
mailing list