Simplify the interface to Module::lookupConformance.

Rather than returning a weird PointerIntPair, return an
Optional<ProtocolConformanceRef>. NFC
This commit is contained in:
Doug Gregor
2016-03-15 22:07:14 -07:00
parent b051c5a70f
commit a31edf53d0
15 changed files with 122 additions and 175 deletions

View File

@@ -167,9 +167,9 @@ collectExistentialConformances(Module *M, Type fromType, Type toType) {
SmallVector<ProtocolConformanceRef, 4> conformances;
for (auto proto : protocols) {
ProtocolConformance *conformance =
auto conformance =
M->lookupConformance(fromType, proto, nullptr).getPointer();
conformances.push_back(ProtocolConformanceRef(proto, conformance));
conformances.push_back(*conformance);
}
return M->getASTContext().AllocateCopy(conformances);