mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[Interpreter] Clean up the /usr/lib/swift fallback code.
- Check the target triple at runtime to decide whether to use the fallback. - Change isInResourceDir to actually check the resource dir. - Use ArrayRef<std::string> instead of std::vector<std::string>.
This commit is contained in:
@@ -1066,12 +1066,9 @@ class ParseableInterfaceModuleLoaderImpl {
|
||||
}
|
||||
|
||||
bool isInResourceDir(StringRef path) {
|
||||
for (auto &RuntimeLibraryPath : ctx.SearchPathOpts.RuntimeLibraryPaths) {
|
||||
if (path.startswith(RuntimeLibraryPath)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
StringRef resourceDir = ctx.SearchPathOpts.RuntimeResourcePath;
|
||||
if (resourceDir.empty()) return false;
|
||||
return path.startswith(resourceDir);
|
||||
}
|
||||
|
||||
/// Finds the most appropriate .swiftmodule, whose dependencies are up to
|
||||
|
||||
Reference in New Issue
Block a user