@@ -79,20 +79,6 @@ void RewriteStep::dump(llvm::raw_ostream &out,
7979
8080 break ;
8181 }
82- case ConcreteConformance: {
83- evaluator.applyConcreteConformance (*this , system);
84-
85- out << (Inverse ? " ConcreteConformance⁻¹"
86- : " ConcreteConformance" );
87- break ;
88- }
89- case SuperclassConformance: {
90- evaluator.applyConcreteConformance (*this , system);
91-
92- out << (Inverse ? " SuperclassConformance⁻¹"
93- : " SuperclassConformance" );
94- break ;
95- }
9682 case ConcreteTypeWitness: {
9783 evaluator.applyConcreteTypeWitness (*this , system);
9884
@@ -411,88 +397,6 @@ RewritePathEvaluator::applyRelation(const RewriteStep &step,
411397 return {lhs, rhs, prefix, suffix};
412398}
413399
414- void
415- RewritePathEvaluator::applyConcreteConformance (const RewriteStep &step,
416- const RewriteSystem &system) {
417- checkPrimary ();
418- auto &term = Primary.back ();
419- Symbol *last = term.end () - step.EndOffset ;
420-
421- auto &ctx = system.getRewriteContext ();
422-
423- if (!step.Inverse ) {
424- // The input term takes one of the following forms, where |V| == EndOffset:
425- // - U.[concrete: C].[P].V
426- // - U.[superclass: C].[P].V
427- assert (term.size () > step.EndOffset + 2 );
428- auto concreteType = *(last - 2 );
429- auto proto = *(last - 1 );
430- assert (proto.getKind () == Symbol::Kind::Protocol);
431-
432- // Get the prefix U.
433- MutableTerm newTerm (term.begin (), last - 2 );
434-
435- // Build the term U.[concrete: C : P].
436- if (step.Kind == RewriteStep::ConcreteConformance) {
437- assert (concreteType.getKind () == Symbol::Kind::ConcreteType);
438-
439- newTerm.add (Symbol::forConcreteConformance (
440- concreteType.getConcreteType (),
441- concreteType.getSubstitutions (),
442- proto.getProtocol (),
443- ctx));
444- } else {
445- assert (step.Kind == RewriteStep::SuperclassConformance);
446- assert (concreteType.getKind () == Symbol::Kind::Superclass);
447-
448- newTerm.add (Symbol::forConcreteConformance (
449- concreteType.getSuperclass (),
450- concreteType.getSubstitutions (),
451- proto.getProtocol (),
452- ctx));
453- }
454-
455- // Add the suffix V to get the final term U.[concrete: C : P].V.
456- newTerm.append (last, term.end ());
457- term = newTerm;
458- } else {
459- // The input term takes the form U.[concrete: C : P].V, where
460- // |V| == EndOffset.
461- assert (term.size () > step.EndOffset + 1 );
462- auto concreteConformance = *(last - 1 );
463- assert (concreteConformance.getKind () == Symbol::Kind::ConcreteConformance);
464-
465- // Build the term U.
466- MutableTerm newTerm (term.begin (), last - 1 );
467-
468- // Add the symbol [concrete: C] or [superclass: C] to get the term
469- // U.[concrete: C] or U.[superclass: C].
470- if (step.Kind == RewriteStep::ConcreteConformance) {
471- newTerm.add (Symbol::forConcreteType (
472- concreteConformance.getConcreteType (),
473- concreteConformance.getSubstitutions (),
474- ctx));
475- } else {
476- assert (step.Kind == RewriteStep::SuperclassConformance);
477- newTerm.add (Symbol::forSuperclass (
478- concreteConformance.getConcreteType (),
479- concreteConformance.getSubstitutions (),
480- ctx));
481- }
482-
483- // Add the symbol [P] to get the term U.[concrete: C].[P] or
484- // U.[superclass: C].[P].
485- newTerm.add (Symbol::forProtocol (
486- concreteConformance.getProtocol (),
487- ctx));
488-
489- // Add the suffix V to get the final term U.[concrete: C].[P].V or
490- // U.[superclass: C].[P].V.
491- newTerm.append (last, term.end ());
492- term = newTerm;
493- }
494- }
495-
496400void RewritePathEvaluator::applyConcreteTypeWitness (const RewriteStep &step,
497401 const RewriteSystem &system) {
498402 checkPrimary ();
@@ -682,11 +586,6 @@ void RewritePathEvaluator::apply(const RewriteStep &step,
682586 applyRelation (step, system);
683587 break ;
684588
685- case RewriteStep::ConcreteConformance:
686- case RewriteStep::SuperclassConformance:
687- applyConcreteConformance (step, system);
688- break ;
689-
690589 case RewriteStep::ConcreteTypeWitness:
691590 applyConcreteTypeWitness (step, system);
692591 break ;
0 commit comments