@@ -285,7 +285,8 @@ namespace {
285
285
void mangleNominalType (Node *node, char basicKind, EntityContext &ctx);
286
286
287
287
void mangleProtocolWithoutPrefix (Node *node);
288
- void mangleProtocolListWithoutPrefix (Node *node);
288
+ void mangleProtocolListWithoutPrefix (Node *node,
289
+ Node *additionalProto = nullptr );
289
290
290
291
void mangleEntityContext (Node *node, EntityContext &ctx);
291
292
void mangleEntityType (Node *node, EntityContext &ctx);
@@ -1215,14 +1216,18 @@ void Remangler::mangleProtocolList(Node *node) {
1215
1216
mangleProtocolListWithoutPrefix (node);
1216
1217
}
1217
1218
1218
- void Remangler::mangleProtocolListWithoutPrefix (Node *node) {
1219
+ void Remangler::mangleProtocolListWithoutPrefix (Node *node,
1220
+ Node *additionalProto) {
1219
1221
assert (node->getKind () == Node::Kind::ProtocolList);
1220
1222
assert (node->getNumChildren () == 1 );
1221
1223
auto typeList = node->begin ()[0 ];
1222
1224
assert (typeList->getKind () == Node::Kind::TypeList);
1223
1225
for (auto &child : *typeList) {
1224
1226
mangleProtocolWithoutPrefix (child);
1225
1227
}
1228
+ if (additionalProto) {
1229
+ mangleProtocolWithoutPrefix (additionalProto);
1230
+ }
1226
1231
Out << ' _' ;
1227
1232
}
1228
1233
@@ -1674,8 +1679,11 @@ void Remangler::mangleProtocolListWithClass(Node *node) {
1674
1679
}
1675
1680
1676
1681
void Remangler::mangleProtocolListWithAnyObject (Node *node) {
1677
- Out << " Xl" ;
1678
- mangleProtocolListWithoutPrefix (node->getChild (0 ));
1682
+ Node *P = Factory.createNode (Node::Kind::Protocol);
1683
+ P->addChild (Factory.createNode (Node::Kind::Module, " Swift" ), Factory);
1684
+ P->addChild (Factory.createNode (Node::Kind::Identifier, " AnyObject" ), Factory);
1685
+ Out << " P" ;
1686
+ mangleProtocolListWithoutPrefix (node->getChild (0 ), /* additionalProto*/ P);
1679
1687
}
1680
1688
1681
1689
void Remangler::mangleVTableThunk (Node *node) {
0 commit comments