Skip to content

Commit f0d33be

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 a859ebe commit f0d33be

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
@@ -2364,7 +2364,6 @@ std::error_code ExplicitSwiftModuleLoader::findModuleFilesInDirectory(
23642364
std::unique_ptr<llvm::MemoryBuffer> *ModuleSourceInfoBuffer,
23652365
bool IsCanImportLookup, bool IsFramework,
23662366
bool IsTestableDependencyLookup) {
2367-
llvm_unreachable("Not supported in the Explicit Swift Module Loader.");
23682367
return std::make_error_code(std::errc::not_supported);
23692368
}
23702369

@@ -2738,7 +2737,6 @@ std::error_code ExplicitCASModuleLoader::findModuleFilesInDirectory(
27382737
std::unique_ptr<llvm::MemoryBuffer> *ModuleSourceInfoBuffer,
27392738
bool IsCanImportLookup, bool IsFramework,
27402739
bool IsTestableDependencyLookup) {
2741-
llvm_unreachable("Not supported in the Explicit Swift Module Loader.");
27422740
return std::make_error_code(std::errc::not_supported);
27432741
}
27442742

0 commit comments

Comments
 (0)