Store a file-level DeclContext* in protocol conformances rather than a module.

We'll need to perform name lookup based on the file-level
DeclContext*, so the module no longer suffices. No functionality
change here yet.


Swift SVN r11523
This commit is contained in:
Doug Gregor
2013-12-20 22:53:21 +00:00
parent 186c0243f1
commit be3463f32d
11 changed files with 49 additions and 47 deletions

View File

@@ -306,7 +306,7 @@ static ProtocolConformance *findConformance(ProtocolDecl *proto,
return nullptr;
if (conformance->getProtocol() == proto) {
if (conformance->getContainingModule() == module)
if (conformance->getDeclContext()->getParentModule() == module)
return conformance;
return nullptr;
}
@@ -314,7 +314,7 @@ static ProtocolConformance *findConformance(ProtocolDecl *proto,
auto &inheritedMap = conformance->getInheritedConformances();
auto directIter = inheritedMap.find(proto);
if (directIter != inheritedMap.end()) {
if (directIter->second->getContainingModule() == module)
if (directIter->second->getDeclContext()->getParentModule() == module)
return directIter->second;
return nullptr;
}
@@ -513,7 +513,7 @@ Optional<ConformancePair> ModuleFile::maybeReadConformance(Type conformingType,
lastRecordOffset.reset();
auto conformance = ctx.getConformance(conformingType, proto, SourceLoc(),
FileContext->getParentModule(),
FileContext,
ProtocolConformanceState::Incomplete);
// Set inherited conformances.