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

@@ -163,8 +163,7 @@ bool swift::isObjectiveCBridgeable(Module *M, CanType Ty) {
// Find the conformance of the value type to _BridgedToObjectiveC.
// Check whether the type conforms to _BridgedToObjectiveC.
auto conformance = M->lookupConformance(Ty, bridgedProto, nullptr);
return (conformance.getInt() != ConformanceKind::DoesNotConform);
return conformance.hasValue();
}
return false;
}
@@ -179,8 +178,7 @@ bool swift::isErrorProtocol(Module *M, CanType Ty) {
// Find the conformance of the value type to _BridgedToObjectiveC.
// Check whether the type conforms to _BridgedToObjectiveC.
auto conformance = M->lookupConformance(Ty, errorTypeProto, nullptr);
return (conformance.getInt() != ConformanceKind::DoesNotConform);
return conformance.hasValue();
}
return false;
}