[NFC] Fold The Tri-State In Optional<ProtocolConformanceRef>

ProtocolConformanceRef already has an invalid state.  Drop all of the
uses of Optional<ProtocolConformanceRef> and just use
ProtocolConformanceRef::forInvalid() to represent it.  Mechanically
translate all of the callers and callsites to use this new
representation.
This commit is contained in:
Robert Widmann
2019-10-29 15:11:15 -07:00
parent 9565300f1b
commit 3e1a61f425
81 changed files with 882 additions and 896 deletions

View File

@@ -409,19 +409,18 @@ public:
/// \returns The result of the conformance search, which will be
/// None if the type does not conform to the protocol or contain a
/// ProtocolConformanceRef if it does conform.
Optional<ProtocolConformanceRef>
lookupConformance(Type type, ProtocolDecl *protocol);
ProtocolConformanceRef lookupConformance(Type type, ProtocolDecl *protocol);
/// Look for the conformance of the given existential type to the given
/// protocol.
Optional<ProtocolConformanceRef>
lookupExistentialConformance(Type type, ProtocolDecl *protocol);
ProtocolConformanceRef lookupExistentialConformance(Type type,
ProtocolDecl *protocol);
/// Exposes TypeChecker functionality for querying protocol conformance.
/// Returns a valid ProtocolConformanceRef only if all conditional
/// requirements are successfully resolved.
Optional<ProtocolConformanceRef>
conformsToProtocol(Type sourceTy, ProtocolDecl *targetProtocol);
ProtocolConformanceRef conformsToProtocol(Type sourceTy,
ProtocolDecl *targetProtocol);
/// Find a member named \p name in \p container that was declared in this
/// module.