[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:
Mike Ash
2019-06-28 14:06:00 -04:00
parent 3f774094b7
commit 9df513ae7c
4 changed files with 15 additions and 20 deletions

View File

@@ -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