[SILGen] Teach SILGen to emit property wrapper generator functions that

take in a projected value.
This commit is contained in:
Holly Borla
2021-02-24 19:36:01 -08:00
parent 13692fefde
commit 648c5753df
21 changed files with 176 additions and 10 deletions

View File

@@ -419,6 +419,7 @@ private:
case Node::Kind::InfixOperator:
case Node::Kind::Initializer:
case Node::Kind::PropertyWrapperBackingInitializer:
case Node::Kind::PropertyWrapperInitFromProjectedValue:
case Node::Kind::KeyPathGetterThunkHelper:
case Node::Kind::KeyPathSetterThunkHelper:
case Node::Kind::KeyPathEqualsThunkHelper:
@@ -1266,6 +1267,10 @@ NodePointer NodePrinter::print(NodePointer Node, bool asPrefixContext) {
return printEntity(
Node, asPrefixContext, TypePrinting::NoType,
/*hasName*/false, "property wrapper backing initializer");
case Node::Kind::PropertyWrapperInitFromProjectedValue:
return printEntity(
Node, asPrefixContext, TypePrinting::NoType,
/*hasName*/false, "property wrapper init from projected value");
case Node::Kind::DefaultArgumentInitializer:
return printEntity(Node, asPrefixContext, TypePrinting::NoType,
/*hasName*/false, "default argument ",
@@ -2897,7 +2902,8 @@ printEntity(NodePointer Entity, bool asPrefixContext, TypePrinting TypePr,
// Print any left over context which couldn't be printed in prefix form.
if (Entity->getKind() == Node::Kind::DefaultArgumentInitializer ||
Entity->getKind() == Node::Kind::Initializer ||
Entity->getKind() == Node::Kind::PropertyWrapperBackingInitializer) {
Entity->getKind() == Node::Kind::PropertyWrapperBackingInitializer ||
Entity->getKind() == Node::Kind::PropertyWrapperInitFromProjectedValue) {
Printer << " of ";
} else {
Printer << " in ";