mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Mangle the protocol constraints on associated types in GenericParamLists.
A short-term fix to <rdar://problem/16079822> that keeps generic overloads from creating symbol collisions without requiring a larger migration of the debugger or other tools. Swift SVN r14353
This commit is contained in:
@@ -1027,19 +1027,30 @@ private:
|
||||
NodePointer demangleGenerics(GenericContext &C) {
|
||||
DemanglerPrinter result_printer;
|
||||
NodePointer archetypes = Node::create(Node::Kind::Generics);
|
||||
// FIXME: Swallow the mangled associated type constraints.
|
||||
bool assocTypes = false;
|
||||
while (true) {
|
||||
if (!assocTypes && Mangled.nextIf('U')) {
|
||||
assocTypes = true;
|
||||
continue;
|
||||
}
|
||||
if (Mangled.nextIf('_')) {
|
||||
if (!Mangled)
|
||||
return nullptr;
|
||||
char c = Mangled.peek();
|
||||
if (c != '_' && c != 'S' && !isStartOfIdentifier(c))
|
||||
if (c != '_' && c != 'S'
|
||||
&& (assocTypes || c != 'U')
|
||||
&& !isStartOfIdentifier(c))
|
||||
break;
|
||||
archetypes->addChild(Node::create(
|
||||
Node::Kind::ArchetypeRef, archetypeName(ArchetypeCount)));
|
||||
if (!assocTypes)
|
||||
archetypes->addChild(Node::create(
|
||||
Node::Kind::ArchetypeRef, archetypeName(ArchetypeCount)));
|
||||
} else {
|
||||
NodePointer proto_list = demangleProtocolList();
|
||||
if (!proto_list)
|
||||
return nullptr;
|
||||
if (assocTypes)
|
||||
continue;
|
||||
NodePointer arch_and_proto =
|
||||
Node::create(Node::Kind::ArchetypeAndProtocol);
|
||||
arch_and_proto->addChild(Node::create(
|
||||
|
||||
Reference in New Issue
Block a user