@@ -443,19 +443,6 @@ class NormalProtocolConformance : public RootProtocolConformance,
443443 // / requirement signature of the protocol.
444444 ArrayRef<ProtocolConformanceRef> SignatureConformances;
445445
446- // / Any additional requirements that are required for this conformance to
447- // / apply, e.g. 'Something: Baz' in 'extension Foo: Bar where Something: Baz'.
448- mutable ArrayRef<Requirement> ConditionalRequirements;
449- enum class ConditionalRequirementsState {
450- Uncomputed,
451- Computing,
452- Complete,
453- };
454- // / The state of the ConditionalRequirements field: whether it has been
455- // / computed or not.
456- mutable ConditionalRequirementsState CRState =
457- ConditionalRequirementsState::Uncomputed;
458-
459446 // / The lazy member loader provides callbacks for populating imported and
460447 // / deserialized conformances.
461448 // /
@@ -467,8 +454,6 @@ class NormalProtocolConformance : public RootProtocolConformance,
467454
468455 void resolveLazyInfo () const ;
469456
470- void differenceAndStoreConditionalRequirements () const ;
471-
472457public:
473458 NormalProtocolConformance (Type conformingType, ProtocolDecl *protocol,
474459 SourceLoc loc, DeclContext *dc,
@@ -493,39 +478,12 @@ class NormalProtocolConformance : public RootProtocolConformance,
493478 return ContextAndInvalid.getPointer ();
494479 }
495480
496- // / Get any additional requirements that are required for this conformance to
497- // / be satisfied if they can be computed.
498- // /
499- // / If \c computeIfPossible is false, this will not do the lazy computation of
500- // / the conditional requirements and will just query the current state. This
501- // / should almost certainly only be used for debugging purposes, prefer \c
502- // / getConditionalRequirementsIfAvailable (these are separate because
503- // / CONFORMANCE_SUBCLASS_DISPATCH does some type checks and a defaulted
504- // / parameter gets in the way of that).
505- Optional<ArrayRef<Requirement>>
506- getConditionalRequirementsIfAvailableOrCached (bool computeIfPossible) const {
507- if (computeIfPossible)
508- differenceAndStoreConditionalRequirements ();
509-
510- if (CRState == ConditionalRequirementsState::Complete)
511- return ConditionalRequirements;
512-
513- return None;
514- }
515- // / Get any additional requirements that are required for this conformance to
516- // / be satisfied if they can be computed.
517- Optional<ArrayRef<Requirement>>
518- getConditionalRequirementsIfAvailable () const {
519- return getConditionalRequirementsIfAvailableOrCached (
520- /* computeIfPossible=*/ true );
521- }
522-
523481 // / Get any additional requirements that are required for this conformance to
524482 // / be satisfied, e.g. for Array<T>: Equatable, T: Equatable also needs
525483 // / to be satisfied.
526- ArrayRef<Requirement> getConditionalRequirements () const {
527- return * getConditionalRequirementsIfAvailable ();
528- }
484+ ArrayRef<Requirement> getConditionalRequirements () const ;
485+
486+ Optional<ArrayRef<Requirement>> getConditionalRequirementsIfAvailable () const ;
529487
530488 // / Retrieve the state of this conformance.
531489 ProtocolConformanceState getState () const {
0 commit comments