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

@@ -271,13 +271,8 @@ SILGenModule::getConformanceToObjectiveCBridgeable(SILLocation loc, Type type) {
// Find the conformance to _ObjectiveCBridgeable.
auto result = SwiftModule->lookupConformance(type, proto, nullptr);
switch (result.getInt()) {
case ConformanceKind::Conforms:
return result.getPointer();
case ConformanceKind::DoesNotConform:
return nullptr;
}
if (result) return result->getConcrete();
return nullptr;
}
SILFunction *SILGenModule::emitTopLevelFunction(SILLocation Loc) {