SILGen: Currying of 'super.method' calls.

Keep track of a second set of "direct method reference" curry thunks that don't end in a dynamic dispatch in order to properly implement a partial application such as 'let foo = super.foo'. Fixes rdar://problem/20598526.

Swift SVN r27538
This commit is contained in:
Joe Groff
2015-04-21 22:56:03 +00:00
parent d9083d2e50
commit 3f38d75006
10 changed files with 112 additions and 16 deletions

View File

@@ -382,6 +382,9 @@ public:
topLevel->addChild(NodeFactory::create(Node::Kind::NonObjCAttribute));
} else if (Mangled.nextIf("TD")) {
topLevel->addChild(NodeFactory::create(Node::Kind::DynamicAttribute));
} else if (Mangled.nextIf("Td")) {
topLevel->addChild(NodeFactory::create(
Node::Kind::DirectMethodReferenceAttribute));
} else if (Mangled.nextIf("TV")) {
topLevel->addChild(NodeFactory::create(Node::Kind::VTableAttribute));
}
@@ -2241,6 +2244,7 @@ private:
case Node::Kind::DependentProtocolWitnessTableTemplate:
case Node::Kind::Destructor:
case Node::Kind::DidSet:
case Node::Kind::DirectMethodReferenceAttribute:
case Node::Kind::Directness:
case Node::Kind::DynamicAttribute:
case Node::Kind::ExplicitClosure:
@@ -2767,6 +2771,9 @@ void NodePrinter::print(NodePointer pointer, bool asContext, bool suppressType)
case Node::Kind::ObjCAttribute:
Printer << "@objc ";
return;
case Node::Kind::DirectMethodReferenceAttribute:
Printer << "super ";
return;
case Node::Kind::DynamicAttribute:
Printer << "dynamic ";
return;