diff --git a/llvm/include/llvm/Support/VirtualFileSystem.h b/llvm/include/llvm/Support/VirtualFileSystem.h --- a/llvm/include/llvm/Support/VirtualFileSystem.h +++ b/llvm/include/llvm/Support/VirtualFileSystem.h @@ -652,7 +652,7 @@ friend class RedirectingFileSystemParser; bool shouldUseExternalFS() const { - return ExternalFSValidWD && IsFallthrough; + return IsFallthrough; } // In a RedirectingFileSystem, keys can be specified in Posix or Windows @@ -672,9 +672,6 @@ /// The current working directory of the file system. std::string WorkingDirectory; - /// Whether the current working directory is valid for the external FS. - bool ExternalFSValidWD = false; - /// The file system to use for external references. IntrusiveRefCntPtr ExternalFS; diff --git a/llvm/lib/Support/VirtualFileSystem.cpp b/llvm/lib/Support/VirtualFileSystem.cpp --- a/llvm/lib/Support/VirtualFileSystem.cpp +++ b/llvm/lib/Support/VirtualFileSystem.cpp @@ -1016,7 +1016,6 @@ if (auto ExternalWorkingDirectory = ExternalFS->getCurrentWorkingDirectory()) { WorkingDirectory = *ExternalWorkingDirectory; - ExternalFSValidWD = true; } } @@ -1076,10 +1075,8 @@ return errc::no_such_file_or_directory; // Always change the external FS but ignore its result. - if (ExternalFS) { - auto EC = ExternalFS->setCurrentWorkingDirectory(Path); - ExternalFSValidWD = !static_cast(EC); - } + if (ExternalFS) + ExternalFS->setCurrentWorkingDirectory(Path); SmallString<128> AbsolutePath; Path.toVector(AbsolutePath);