[SE-0095] [Runtime], [Demangler], & AST printer updated to new composition syntax

- All parts of the compiler now use ‘P1 & P2’ syntax
- The demangler and AST printer wrap the composition in parens if it is
in a metatype lookup
- IRGen mangles compositions differently
    - “protocol<>” is now “swift.Any”
    - “protocol<_TP1P,_TP1Q>” is now “_TP1P&_TP1Q”
- Tests cases are updated and added to test the new syntax and mangling
This commit is contained in:
Joe
2016-07-08 03:12:45 +01:00
committed by Doug Gregor
parent 622c86bbcf
commit 3938d5682a
68 changed files with 321 additions and 309 deletions

View File

@@ -3465,12 +3465,10 @@ void NodePrinter::print(NodePointer pointer, bool asContext, bool suppressType)
NodePointer type_list = pointer->getChild(0);
if (!type_list)
return;
bool needs_proto_marker = (type_list->getNumChildren() != 1);
if (needs_proto_marker)
Printer << "protocol<";
printChildren(type_list, ", ");
if (needs_proto_marker)
Printer << ">";
if (type_list->getNumChildren() == 0)
Printer << "Any";
else
printChildren(type_list, " & ");
return;
}
case Node::Kind::Archetype: {