mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[Serialization] Rewrite cross-references to private frameworks.
When serializing cross-references to a (private) module that is re-exported through another (public) module, record the cross-reference as if the entity were found in named public module. Finishes rdar://problem/34438586.
This commit is contained in:
@@ -23,7 +23,7 @@
|
||||
#include "swift/ClangImporter/ClangImporter.h"
|
||||
#include "swift/Serialization/BCReadingExtras.h"
|
||||
#include "swift/Serialization/SerializedModuleLoader.h"
|
||||
|
||||
#include "clang/Basic/Module.h"
|
||||
#include "llvm/ADT/StringExtras.h"
|
||||
#include "llvm/Support/MemoryBuffer.h"
|
||||
#include "llvm/Support/OnDiskHashTable.h"
|
||||
@@ -1563,6 +1563,15 @@ void ModuleFile::loadExtensions(NominalTypeDecl *nominal) {
|
||||
|
||||
if (nominal->getParent()->isModuleScopeContext()) {
|
||||
Identifier moduleName = nominal->getParentModule()->getName();
|
||||
|
||||
// If the originating module is a private module whose interface is
|
||||
// re-exported via public module, check the name of the public module.
|
||||
if (auto clangModule
|
||||
= nominal->getParentModule()->findUnderlyingClangModule()) {
|
||||
if (!clangModule->ExportAsModule.empty())
|
||||
moduleName = getContext().getIdentifier(clangModule->ExportAsModule);
|
||||
}
|
||||
|
||||
for (auto item : *iter) {
|
||||
if (item.first != moduleName.str())
|
||||
continue;
|
||||
|
||||
Reference in New Issue
Block a user