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:
Joe Groff
2014-02-25 21:56:04 +00:00
parent 4af20816a6
commit 89807a939e
3 changed files with 32 additions and 7 deletions

View File

@@ -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(