[IDE][AST] Handle frameworks with traditional overlays where the underlying module declares cross imports in sourcekit.

We weren't handling this case, so their generated interfaces / doc info
wouldn't include symbols from the cross-import overlays, and we wouldn't
map the underscored cross-import overlay name back to the declaring
framework's name in cusor-info, completion results or when indexing.

Resolves rdar://problem/62138551
This commit is contained in:
Nathan Hawes
2020-04-22 19:35:33 -07:00
parent 82d73b531b
commit b7ac8f87b1
15 changed files with 841 additions and 30 deletions

View File

@@ -1218,6 +1218,10 @@ StringRef SerializedASTFile::getTargetTriple() const {
return File.getTargetTriple();
}
ModuleDecl *SerializedASTFile::getUnderlyingModuleIfOverlay() const {
return File.getUnderlyingModule();
}
const clang::Module *SerializedASTFile::getUnderlyingClangModule() const {
if (auto *UnderlyingModule = File.getUnderlyingModule())
return UnderlyingModule->findUnderlyingClangModule();