mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Push Clang's "exported module name" notion up to Swift's FileUnit
It's a pretty obscure feature (and one we wish we didn't need), but sometimes API is initially exposed through one module in order to build another one, and we want the canonical presented name to be something else. Push this concept into Swift's AST properly so that other parts of the compiler stop having to know that this is a Clang-specific special case. No functionality change in this commit; will be used in the next commit.
This commit is contained in:
@@ -25,7 +25,6 @@
|
||||
#include "swift/AST/USRGeneration.h"
|
||||
#include "swift/Basic/Range.h"
|
||||
#include "swift/ClangImporter/ClangImporter.h"
|
||||
#include "swift/ClangImporter/ClangModule.h"
|
||||
#include "swift/Serialization/BCReadingExtras.h"
|
||||
#include "swift/Serialization/SerializedModuleLoader.h"
|
||||
#include "llvm/ADT/StringExtras.h"
|
||||
@@ -1842,15 +1841,8 @@ void ModuleFile::loadExtensions(NominalTypeDecl *nominal) {
|
||||
}
|
||||
|
||||
if (nominal->getParent()->isModuleScopeContext()) {
|
||||
auto parentModule = nominal->getParentModule();
|
||||
StringRef moduleName = parentModule->getName().str();
|
||||
|
||||
// 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 clangModuleUnit =
|
||||
dyn_cast<ClangModuleUnit>(parentModule->getFiles().front())) {
|
||||
moduleName = clangModuleUnit->getExportedModuleName();
|
||||
}
|
||||
auto parentFile = cast<FileUnit>(nominal->getParent());
|
||||
StringRef moduleName = parentFile->getExportedModuleName();
|
||||
|
||||
for (auto item : *iter) {
|
||||
if (item.first != moduleName)
|
||||
|
||||
Reference in New Issue
Block a user