@@ -49,26 +49,6 @@ bool PropertyMap::checkRulePairOnce(unsigned firstRuleID,
49
49
std::make_pair (firstRuleID, secondRuleID)).second ;
50
50
}
51
51
52
- unsigned RewriteSystem::recordRelation (Symbol lhs, Symbol rhs) {
53
- auto key = std::make_pair (lhs, rhs);
54
- auto found = RelationMap.find (key);
55
- if (found != RelationMap.end ())
56
- return found->second ;
57
-
58
- unsigned index = Relations.size ();
59
- Relations.push_back (key);
60
- auto inserted = RelationMap.insert (std::make_pair (key, index));
61
- assert (inserted.second );
62
- (void ) inserted;
63
-
64
- return index;
65
- }
66
-
67
- RewriteSystem::Relation
68
- RewriteSystem::getRelation (unsigned index) const {
69
- return Relations[index];
70
- }
71
-
72
52
// / Given a key T, a rule (V.[p1] => V) where T == U.V, and a property [p2]
73
53
// / where [p1] < [p2], record a rule (T.[p2] => T) that is induced by
74
54
// / the original rule (V.[p1] => V).
@@ -814,57 +794,6 @@ void PropertyMap::concretizeTypeWitnessInConformance(
814
794
}
815
795
}
816
796
817
- RewriteSystem::TypeWitness::TypeWitness (
818
- Term lhs, llvm::PointerUnion<Symbol, Term> rhs)
819
- : LHS(lhs), RHS(rhs) {
820
- assert (LHS.size () >= 2 );
821
- assert (getConcreteConformance ().getKind () ==
822
- Symbol::Kind::ConcreteConformance);
823
- assert (getAssocType ().getKind () == Symbol::Kind::AssociatedType);
824
- if (RHS.is <Symbol>())
825
- assert (RHS.get <Symbol>().getKind () == Symbol::Kind::ConcreteType);
826
- assert (getAssocType ().getProtocols ().size () == 1 );
827
- assert (getAssocType ().getProtocols ()[0 ] ==
828
- getConcreteConformance ().getProtocol ());
829
- }
830
-
831
- namespace swift {
832
- namespace rewriting {
833
- bool operator ==(const RewriteSystem::TypeWitness &lhs,
834
- const RewriteSystem::TypeWitness &rhs) {
835
- return lhs.LHS == rhs.LHS && lhs.RHS == rhs.RHS ;
836
- }
837
- }
838
- }
839
-
840
- void RewriteSystem::TypeWitness::dump (llvm::raw_ostream &out) const {
841
- out << " Subject type: " << LHS << " \n " ;
842
- if (RHS.is <Symbol>())
843
- out << " Concrete type witness: " << RHS.get <Symbol>() << " \n " ;
844
- else
845
- out << " Abstract type witness: " << RHS.get <Term>() << " \n " ;
846
- }
847
-
848
- unsigned RewriteSystem::recordTypeWitness (
849
- RewriteSystem::TypeWitness witness) {
850
- unsigned index = TypeWitnesses.size ();
851
- auto inserted = TypeWitnessMap.insert (std::make_pair (witness.LHS , index));
852
-
853
- if (!inserted.second ) {
854
- index = inserted.first ->second ;
855
- } else {
856
- TypeWitnesses.push_back (witness);
857
- }
858
-
859
- assert (TypeWitnesses[index] == witness);
860
- return index;
861
- }
862
-
863
- const RewriteSystem::TypeWitness &
864
- RewriteSystem::getTypeWitness (unsigned index) const {
865
- return TypeWitnesses[index];
866
- }
867
-
868
797
// / Given the key of a property bag known to have \p concreteType,
869
798
// / together with a \p typeWitness from a conformance on that concrete
870
799
// / type, return the right hand side of a rewrite rule to relate
0 commit comments