mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Add support for loading cross-import files
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user