@@ -45,6 +45,7 @@ static bool isDeclName(Node::Kind kind) {
4545 case Node::Kind::InfixOperator:
4646 case Node::Kind::TypeSymbolicReference:
4747 case Node::Kind::ProtocolSymbolicReference:
48+ case Node::Kind::ObjectiveCProtocolSymbolicReference:
4849 return true ;
4950 default :
5051 return false ;
@@ -58,6 +59,7 @@ static bool isAnyGeneric(Node::Kind kind) {
5859 case Node::Kind::Enum:
5960 case Node::Kind::Protocol:
6061 case Node::Kind::ProtocolSymbolicReference:
62+ case Node::Kind::ObjectiveCProtocolSymbolicReference:
6163 case Node::Kind::OtherNominalType:
6264 case Node::Kind::TypeAlias:
6365 case Node::Kind::TypeSymbolicReference:
@@ -278,6 +280,7 @@ static bool isProtocolNode(Demangle::NodePointer Node) {
278280 return isProtocolNode (Node->getChild (0 ));
279281 case Demangle::Node::Kind::Protocol:
280282 case Demangle::Node::Kind::ProtocolSymbolicReference:
283+ case Demangle::Node::Kind::ObjectiveCProtocolSymbolicReference:
281284 return true ;
282285 default :
283286 return false ;
@@ -870,6 +873,10 @@ NodePointer Demangler::demangleSymbolicReference(unsigned char rawKind) {
870873 kind = SymbolicReferenceKind::NonUniqueExtendedExistentialTypeShape;
871874 direct = Directness::Direct;
872875 break ;
876+ case 0x0c :
877+ kind = SymbolicReferenceKind::ObjectiveCProtocol;
878+ direct = Directness::Direct;
879+ break ;
873880 // These are all currently reserved but unused.
874881 case 0x03 : // direct to protocol conformance descriptor
875882 case 0x04 : // indirect to protocol conformance descriptor
@@ -893,8 +900,10 @@ NodePointer Demangler::demangleSymbolicReference(unsigned char rawKind) {
893900
894901 // Types register as substitutions even when symbolically referenced.
895902 // OOPS: Except for opaque type references!
896- if (kind == SymbolicReferenceKind::Context &&
897- resolved->getKind () != Node::Kind::OpaqueTypeDescriptorSymbolicReference &&
903+ if ((kind == SymbolicReferenceKind::Context ||
904+ kind == SymbolicReferenceKind::ObjectiveCProtocol) &&
905+ resolved->getKind () !=
906+ Node::Kind::OpaqueTypeDescriptorSymbolicReference &&
898907 resolved->getKind () != Node::Kind::OpaqueReturnTypeOf)
899908 addSubstitution (resolved);
900909 return resolved;
@@ -1753,6 +1762,9 @@ NodePointer Demangler::popProtocol() {
17531762
17541763 if (NodePointer SymbolicRef = popNode (Node::Kind::ProtocolSymbolicReference)){
17551764 return SymbolicRef;
1765+ } else if (NodePointer SymbolicRef =
1766+ popNode (Node::Kind::ObjectiveCProtocolSymbolicReference)) {
1767+ return SymbolicRef;
17561768 }
17571769
17581770 NodePointer Name = popNode (isDeclName);
@@ -2584,6 +2596,8 @@ NodePointer Demangler::popAssocTypeName() {
25842596 // If we haven't seen a protocol, check for a symbolic reference.
25852597 if (!Proto)
25862598 Proto = popNode (Node::Kind::ProtocolSymbolicReference);
2599+ if (!Proto)
2600+ Proto = popNode (Node::Kind::ObjectiveCProtocolSymbolicReference);
25872601
25882602 NodePointer Id = popNode (Node::Kind::Identifier);
25892603 NodePointer AssocTy = createWithChild (Node::Kind::DependentAssociatedTypeRef, Id);
0 commit comments