Skip to content

Commit af77ec6

Browse files
authored
Merge pull request #31656 from gribozavr/fix-abstraction-pattern-print-for-cxx
Correctly print an AbstractionPattern with C++ method types
2 parents f2b3f8f + 68bc265 commit af77ec6

File tree

1 file changed

+20
-12
lines changed

1 file changed

+20
-12
lines changed

lib/SIL/IR/AbstractionPattern.cpp

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -765,22 +765,13 @@ void AbstractionPattern::print(raw_ostream &out) const {
765765
case Kind::CurriedCFunctionAsMethodType:
766766
case Kind::PartialCurriedCFunctionAsMethodType:
767767
case Kind::CFunctionAsMethodType:
768-
case Kind::CXXMethodType:
769-
case Kind::CurriedCXXMethodType:
770-
case Kind::PartialCurriedCXXMethodType:
771768
out << (getKind() == Kind::ClangType
772769
? "AP::ClangType(" :
773770
getKind() == Kind::CurriedCFunctionAsMethodType
774771
? "AP::CurriedCFunctionAsMethodType(" :
775-
getKind() == Kind::CFunctionAsMethodType
776-
? "AP::CFunctionAsMethodType(" :
777-
getKind() == Kind::CXXMethodType
778-
? "AP::CXXMethodType(" :
779-
getKind() == Kind::CurriedCXXMethodType
780-
? "AP::CurriedCXXMethodType(" :
781-
getKind() == Kind::PartialCurriedCXXMethodType
782-
? "AP::PartialCurriedCXXMethodType("
783-
: "AP::PartialCurriedCFunctionAsMethodType(");
772+
getKind() == Kind::PartialCurriedCFunctionAsMethodType
773+
? "AP::PartialCurriedCFunctionAsMethodType("
774+
: "AP::CFunctionAsMethodType(");
784775
if (auto sig = getGenericSignature()) {
785776
sig->print(out);
786777
}
@@ -800,6 +791,23 @@ void AbstractionPattern::print(raw_ostream &out) const {
800791
}
801792
out << ")";
802793
return;
794+
case Kind::CXXMethodType:
795+
case Kind::CurriedCXXMethodType:
796+
case Kind::PartialCurriedCXXMethodType:
797+
out << (getKind() == Kind::CXXMethodType
798+
? "AP::CXXMethodType(" :
799+
getKind() == Kind::CurriedCXXMethodType
800+
? "AP::CurriedCXXMethodType("
801+
: "AP::PartialCurriedCXXMethodType");
802+
if (auto sig = getGenericSignature()) {
803+
sig->print(out);
804+
}
805+
getType().dump(out);
806+
out << ", ";
807+
getCXXMethod()->dump();
808+
assert(!hasImportAsMemberStatus());
809+
out << ")";
810+
return;
803811
case Kind::CurriedObjCMethodType:
804812
case Kind::PartialCurriedObjCMethodType:
805813
case Kind::ObjCMethodType:

0 commit comments

Comments
 (0)