Add support for loading cross-import files

This commit is contained in:
Brent Royal-Gordon
2020-02-15 12:17:16 -08:00
parent 6cce3d374e
commit e248f82773
33 changed files with 467 additions and 10 deletions

View File

@@ -2813,3 +2813,13 @@ ClassDecl *SerializedASTFile::getMainClass() const {
const version::Version &SerializedASTFile::getLanguageVersionBuiltWith() const {
return File.CompatibilityVersion;
}
StringRef SerializedASTFile::getModuleDefiningPath() const {
StringRef moduleFilename = getFilename();
StringRef parentDir = llvm::sys::path::parent_path(moduleFilename);
if (llvm::sys::path::extension(parentDir) == ".swiftmodule")
return parentDir;
return moduleFilename;
}