@@ -675,15 +675,6 @@ AbstractionPattern AbstractionPattern::getPackExpansionPatternType() const {
675675 llvm_unreachable (" bad kind" );
676676}
677677
678- SmallVector<AbstractionPattern, 4 >
679- AbstractionPattern::getPackExpandedComponents () const {
680- SmallVector<AbstractionPattern, 4 > result;
681- forEachPackExpandedComponent ([&](AbstractionPattern pattern) {
682- result.push_back (pattern);
683- });
684- return result;
685- }
686-
687678size_t AbstractionPattern::getNumPackExpandedComponents () const {
688679 assert (isPackExpansion ());
689680 assert (getKind () == Kind::Type || getKind () == Kind::Discard);
@@ -699,40 +690,6 @@ size_t AbstractionPattern::getNumPackExpandedComponents() const {
699690 return substShape->getNumElements ();
700691}
701692
702- void AbstractionPattern::forEachPackExpandedComponent (
703- llvm::function_ref<void (AbstractionPattern)> fn) const {
704- assert (isPackExpansion ());
705-
706- switch (getKind ()) {
707- case Kind::Type:
708- case Kind::Discard: {
709- // If we don't have generic substitutions, just produce this pattern.
710- if (!GenericSubs) return fn (*this );
711- auto origExpansion = cast<PackExpansionType>(getType ());
712-
713- // Substitute the expansion shape.
714- auto substShape = cast<PackType>(
715- origExpansion.getCountType ().subst (GenericSubs)->getCanonicalType ());
716-
717- // Call the callback with each component of the substituted shape.
718- for (auto substShapeElt : substShape.getElementTypes ()) {
719- CanType origEltType = origExpansion.getPatternType ();
720- if (auto substShapeEltExpansion =
721- dyn_cast<PackExpansionType>(substShapeElt)) {
722- origEltType = CanPackExpansionType::get (origEltType,
723- substShapeEltExpansion.getCountType ());
724- }
725- fn (AbstractionPattern (GenericSubs, GenericSig, origEltType));
726- }
727- return ;
728- }
729-
730- default :
731- llvm_unreachable (" not a pack expansion" );
732- }
733- llvm_unreachable (" bad kind" );
734- }
735-
736693AbstractionPattern AbstractionPattern::removingMoveOnlyWrapper () const {
737694 switch (getKind ()) {
738695 case Kind::Invalid:
0 commit comments