mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[serialization] Allow references to Clang-imported values.
This unfortunately duplicates the hack of directly referencing the Clang module loader if a cross-reference points to the current module; ideally we'd have some kind of module chain, but I'd settle for a refactoring of the code to share with NameBinding. Additionally, Clang nodes are not actually validated to be from the right module, which could be problematic for extensions or any case of actual name collision. Swift SVN r6519
This commit is contained in:
@@ -177,6 +177,9 @@ Module *SerializedModuleLoader::loadModule(SourceLoc importLoc,
|
||||
auto module = new (Ctx) SerializedModule(Ctx, *this, moduleID.first, comp,
|
||||
loadedModuleFile.get());
|
||||
|
||||
// Whether we succeed or fail, don't try to load this module again.
|
||||
Ctx.LoadedModules[moduleID.first.str()] = module;
|
||||
|
||||
if (loadedModuleFile) {
|
||||
bool success = loadedModuleFile->associateWithModule(module);
|
||||
if (success) {
|
||||
@@ -216,8 +219,6 @@ Module *SerializedModuleLoader::loadModule(SourceLoc importLoc,
|
||||
}
|
||||
}
|
||||
|
||||
// Whether we succeeded or failed, don't try to load this module again.
|
||||
Ctx.LoadedModules[moduleID.first.str()] = module;
|
||||
return module;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user