mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[Mangling] Allow standard substitutions in protocol mangling.
Protocol name mangling didn’t always go through a path that allowed the use of standard substitutions. Enable standard substitutions for protocol name manglings where they make sense. Removes ~277k from the standard library binary size.
This commit is contained in:
@@ -1195,6 +1195,17 @@ NodePointer Demangler::popTypeList() {
|
||||
}
|
||||
|
||||
NodePointer Demangler::popProtocol() {
|
||||
if (NodePointer Type = popNode(Node::Kind::Type)) {
|
||||
if (Type->getNumChildren() < 1)
|
||||
return nullptr;
|
||||
|
||||
NodePointer Proto = Type->getChild(0);
|
||||
if (Proto->getKind() != Node::Kind::Protocol)
|
||||
return nullptr;
|
||||
|
||||
return Type;
|
||||
}
|
||||
|
||||
NodePointer Name = popNode(isDeclName);
|
||||
NodePointer Ctx = popContext();
|
||||
NodePointer Proto = createWithChildren(Node::Kind::Protocol, Ctx, Name);
|
||||
|
||||
Reference in New Issue
Block a user