Skip to content

Commit 04f4be6

Browse files
[ModuleLoader] Remove llvm_unreachable in findModuleFilesInDirectory()
In the explicit module loaders, findModuleFilesInDirectory() is not a supported operation and swift compiler is not expected to call this function, thus it uses `llvm_unreachable`. However, LLDB and other clients can configure module loader that allow fallbacks from explicit module loaders, thus we should function calls to actually return and not terminating the process. Just let the function return `not_supported`. rdar://166557713
1 parent 6e5ba7a commit 04f4be6

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

lib/Frontend/ModuleInterfaceLoader.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2380,7 +2380,6 @@ std::error_code ExplicitSwiftModuleLoader::findModuleFilesInDirectory(
23802380
std::unique_ptr<llvm::MemoryBuffer> *ModuleSourceInfoBuffer,
23812381
bool IsCanImportLookup, bool IsFramework,
23822382
bool IsTestableDependencyLookup) {
2383-
llvm_unreachable("Not supported in the Explicit Swift Module Loader.");
23842383
return std::make_error_code(std::errc::not_supported);
23852384
}
23862385

@@ -2754,7 +2753,6 @@ std::error_code ExplicitCASModuleLoader::findModuleFilesInDirectory(
27542753
std::unique_ptr<llvm::MemoryBuffer> *ModuleSourceInfoBuffer,
27552754
bool IsCanImportLookup, bool IsFramework,
27562755
bool IsTestableDependencyLookup) {
2757-
llvm_unreachable("Not supported in the Explicit Swift Module Loader.");
27582756
return std::make_error_code(std::errc::not_supported);
27592757
}
27602758

0 commit comments

Comments
 (0)