@@ -578,33 +578,6 @@ void PropertyMap::checkConcreteTypeRequirements(
578
578
}
579
579
}
580
580
581
- // / For each fully-concrete type, find the shortest term having that concrete type.
582
- // / This is later used by computeConstraintTermForTypeWitness().
583
- void PropertyMap::computeConcreteTypeInDomainMap () {
584
- for (auto *props : Entries) {
585
- if (!props->isConcreteType ())
586
- continue ;
587
-
588
- auto concreteType = props->ConcreteType ->getConcreteType ();
589
- if (concreteType->hasTypeParameter ())
590
- continue ;
591
-
592
- assert (props->ConcreteType ->getSubstitutions ().empty ());
593
-
594
- auto domain = props->Key .getRootProtocols ();
595
- auto concreteTypeKey = std::make_pair (concreteType, domain);
596
-
597
- auto found = ConcreteTypeInDomainMap.find (concreteTypeKey);
598
- if (found != ConcreteTypeInDomainMap.end ())
599
- continue ;
600
-
601
- auto inserted = ConcreteTypeInDomainMap.insert (
602
- std::make_pair (concreteTypeKey, props->Key ));
603
- assert (inserted.second );
604
- (void ) inserted;
605
- }
606
- }
607
-
608
581
void PropertyMap::concretizeNestedTypesFromConcreteParents (
609
582
SmallVectorImpl<InducedRule> &inducedRules) {
610
583
for (auto *props : Entries) {
@@ -1003,9 +976,6 @@ MutableTerm PropertyMap::computeConstraintTermForTypeWitness(
1003
976
if (requirementKind == RequirementKind::SameType &&
1004
977
typeWitnessSymbol.getConcreteType () == concreteType &&
1005
978
typeWitnessSymbol.getSubstitutions () == substitutions) {
1006
- // FIXME: ConcreteTypeInDomainMap should support substitutions so
1007
- // that we can remove this.
1008
-
1009
979
if (Debug.contains (DebugFlags::ConcretizeNestedTypes)) {
1010
980
llvm::dbgs () << " ^^ Type witness is the same as the concrete type\n " ;
1011
981
}
@@ -1028,29 +998,6 @@ MutableTerm PropertyMap::computeConstraintTermForTypeWitness(
1028
998
return result;
1029
999
}
1030
1000
1031
- // If the type witness is completely concrete, try to introduce a
1032
- // same-type requirement with another representative type parameter,
1033
- // if we have one.
1034
- if (!typeWitness->hasTypeParameter ()) {
1035
- // Check if we have a shorter representative we can use.
1036
- auto domain = key.getRootProtocols ();
1037
- auto concreteTypeKey = std::make_pair (typeWitness, domain);
1038
-
1039
- auto found = ConcreteTypeInDomainMap.find (concreteTypeKey);
1040
- if (found != ConcreteTypeInDomainMap.end ()) {
1041
- MutableTerm result (found->second );
1042
- if (result != subjectType) {
1043
- if (Debug.contains (DebugFlags::ConcretizeNestedTypes)) {
1044
- llvm::dbgs () << " ^^ Type witness can re-use property bag of "
1045
- << found->second << " \n " ;
1046
- }
1047
-
1048
- // FIXME: Record a rewrite path.
1049
- return result;
1050
- }
1051
- }
1052
- }
1053
-
1054
1001
// Otherwise, add a concrete type requirement for the type witness.
1055
1002
//
1056
1003
// Add a rule:
0 commit comments