mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Eliminate NominalTypeDecl::(get|set)Conformances.
We now access the conformances of a nominal type through the conformance lookup table, so there is no reason to continue storing conformances directly on the nominal type declaration, which was error-prone regardless. This mirrors the change to ExtensionDecl from my previous commit. Swift SVN r26354
This commit is contained in:
@@ -781,16 +781,19 @@ void NominalTypeDecl::setMemberLoader(LazyMemberLoader *resolver,
|
||||
IterableDeclContext::setLoader(resolver, contextData);
|
||||
}
|
||||
|
||||
ArrayRef<ProtocolConformance*> NominalTypeDecl::getConformances() const {
|
||||
loadAllConformances(this, Conformances);
|
||||
return Conformances.getArray();
|
||||
}
|
||||
|
||||
void NominalTypeDecl::setConformanceLoader(LazyMemberLoader *resolver,
|
||||
uint64_t contextData) {
|
||||
assert(!Conformances.isLazy() && "already have a resolver");
|
||||
assert(Conformances.getArray().empty() && "already have conformances");
|
||||
Conformances.setLoader(resolver, contextData);
|
||||
assert(!HaveConformanceLoader &&
|
||||
"Already have a conformance loader");
|
||||
HaveConformanceLoader = true;
|
||||
getASTContext().recordConformanceLoader(this, resolver, contextData);
|
||||
}
|
||||
|
||||
std::pair<LazyMemberLoader *, uint64_t>
|
||||
NominalTypeDecl::takeConformanceLoaderSlow() {
|
||||
assert(HaveConformanceLoader && "no conformance loader?");
|
||||
HaveConformanceLoader = false;
|
||||
return getASTContext().takeConformanceLoader(this);
|
||||
}
|
||||
|
||||
ExtensionDecl::ExtensionDecl(SourceLoc extensionLoc,
|
||||
@@ -878,7 +881,8 @@ void ExtensionDecl::setConformanceLoader(LazyMemberLoader *resolver,
|
||||
getASTContext().recordConformanceLoader(this, resolver, contextData);
|
||||
}
|
||||
|
||||
std::pair<LazyMemberLoader *, uint64_t> ExtensionDecl::takeConformanceLoaderSlow() {
|
||||
std::pair<LazyMemberLoader *, uint64_t>
|
||||
ExtensionDecl::takeConformanceLoaderSlow() {
|
||||
assert(ExtensionDeclBits.HaveConformanceLoader && "no conformance loader?");
|
||||
ExtensionDeclBits.HaveConformanceLoader = false;
|
||||
return getASTContext().takeConformanceLoader(this);
|
||||
|
||||
Reference in New Issue
Block a user