mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
IRGen: Make outlined enum copy/destroy lazier and better mangled.
Emit enum copy/destroy methods only when codegen demands them; they previously got emitted immediately when TypeInfo is instantiated, which led to many functions getting emitted that were never used. Also, make it so that the symbol name includes the full type of the enum instance the outlined functions operate on, so it's more obvious what they'e being used for and they can be ODRed across translation units.
This commit is contained in:
@@ -892,10 +892,14 @@ NodePointer NodePrinter::print(NodePointer Node, bool asPrefixContext) {
|
||||
case Node::Kind::OutlinedCopy:
|
||||
Printer << "outlined copy of ";
|
||||
print(Node->getChild(0));
|
||||
if (Node->getNumChildren() > 1)
|
||||
print(Node->getChild(1));
|
||||
return nullptr;
|
||||
case Node::Kind::OutlinedConsume:
|
||||
Printer << "outlined consume of ";
|
||||
print(Node->getChild(0));
|
||||
if (Node->getNumChildren() > 1)
|
||||
print(Node->getChild(1));
|
||||
return nullptr;
|
||||
case Node::Kind::OutlinedRetain:
|
||||
Printer << "outlined retain of ";
|
||||
|
||||
Reference in New Issue
Block a user