Skip to content

Commit 40e2a7c

Browse files
committed
master-next: Fix up recent Swift changes to work with newer VFS code.
The main different here is that VFS moved from clang to llvm.
1 parent 5e16a65 commit 40e2a7c

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

lib/Serialization/SerializedModuleLoader.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,12 @@ std::error_code SerializedModuleLoaderBase::openModuleFiles(
5858
// If there are no buffers to load into, simply check for the existence of
5959
// the module file.
6060
if (!(ModuleBuffer || ModuleDocBuffer)) {
61-
llvm::ErrorOr<clang::vfs::Status> statResult = FS.status(ModulePath);
61+
llvm::ErrorOr<llvm::vfs::Status> statResult = FS.status(ModulePath);
6262
if (!statResult)
6363
return statResult.getError();
6464
if (!statResult->exists())
6565
return std::make_error_code(std::errc::no_such_file_or_directory);
66-
// FIXME: clang::vfs::FileSystem doesn't give us information on whether or
66+
// FIXME: llvm::vfs::FileSystem doesn't give us information on whether or
6767
// not we can /read/ the file without actually trying to do so.
6868
return std::error_code();
6969
}
@@ -111,17 +111,17 @@ std::error_code SerializedModuleLoader::findModuleFilesInDirectory(
111111
bool SerializedModuleLoader::maybeDiagnoseArchitectureMismatch(
112112
SourceLoc sourceLocation, StringRef moduleName, StringRef archName,
113113
StringRef directoryPath) {
114-
clang::vfs::FileSystem &fs = *Ctx.SourceMgr.getFileSystem();
114+
llvm::vfs::FileSystem &fs = *Ctx.SourceMgr.getFileSystem();
115115

116116
std::error_code errorCode;
117117
std::string foundArchs;
118-
for (clang::vfs::directory_iterator directoryIterator =
118+
for (llvm::vfs::directory_iterator directoryIterator =
119119
fs.dir_begin(directoryPath, errorCode), endIterator;
120120
directoryIterator != endIterator;
121121
directoryIterator.increment(errorCode)) {
122122
if (errorCode)
123123
return false;
124-
StringRef filePath = directoryIterator->getName();
124+
StringRef filePath = directoryIterator->path();
125125
StringRef extension = llvm::sys::path::extension(filePath);
126126
if (file_types::lookupTypeForExtension(extension) ==
127127
file_types::TY_SwiftModuleFile) {
@@ -198,7 +198,7 @@ SerializedModuleLoaderBase::findModule(AccessPathElem moduleID,
198198

199199
currPath = path;
200200
llvm::sys::path::append(currPath, moduleFilename.str());
201-
llvm::ErrorOr<clang::vfs::Status> statResult = fs.status(currPath);
201+
llvm::ErrorOr<llvm::vfs::Status> statResult = fs.status(currPath);
202202

203203
if (statResult && statResult->isDirectory()) {
204204
// A .swiftmodule directory contains architecture-specific files.

0 commit comments

Comments
 (0)