Skip to content

Commit d093879

Browse files
committed
Reinstate SubstitutionList-based printing for SIL and specialized conformances.
The SIL parser depends on these, still.
1 parent 791df5b commit d093879

File tree

2 files changed

+3
-17
lines changed

2 files changed

+3
-17
lines changed

lib/AST/ASTPrinter.cpp

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4157,14 +4157,8 @@ void ProtocolConformance::printName(llvm::raw_ostream &os,
41574157
case ProtocolConformanceKind::Specialized: {
41584158
auto spec = cast<SpecializedProtocolConformance>(this);
41594159
os << "specialize <";
4160-
auto subMap = spec->getSubstitutionMap();
4161-
auto genericParams =
4162-
spec->getGenericConformance()->getGenericSignature()->getGenericParams();
4163-
interleave(genericParams,
4164-
[&](Type type) {
4165-
type.subst(subMap).print(os, PO);
4166-
4167-
},
4160+
interleave(spec->getSubstitutionMap().toList(),
4161+
[&](const Substitution &s) { s.print(os, PO); },
41684162
[&] { os << ", "; });
41694163

41704164
os << "> (";

lib/SIL/SILPrinter.cpp

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1066,15 +1066,7 @@ class SILPrinter : public SILInstructionVisitor<SILPrinter> {
10661066
}
10671067

10681068
void printSubstitutions(SubstitutionMap Subs) {
1069-
if (Subs.empty())
1070-
return;
1071-
1072-
*this << '<';
1073-
interleave(Subs.getReplacementTypes(),
1074-
[&](Type type) { *this << type; },
1075-
[&] { *this << ", "; });
1076-
*this << '>';
1077-
1069+
printSubstitutions(Subs.toList());
10781070
}
10791071

10801072
void printSubstitutions(SubstitutionList Subs) {

0 commit comments

Comments
 (0)