diff --git a/docs/ABI/Mangling.rst b/docs/ABI/Mangling.rst index ea37b36afc9ad..d31e0d4483789 100644 --- a/docs/ABI/Mangling.rst +++ b/docs/ABI/Mangling.rst @@ -331,6 +331,7 @@ with a differentiable function used for differentiable programming. global ::= generic-signature? type 'WOe' // Outlined consume global ::= generic-signature? type 'WOr' // Outlined retain global ::= generic-signature? type 'WOs' // Outlined release + global ::= generic-signature? type 'WOB' // Outlined initializeWithTake, not using value witness global ::= generic-signature? type 'WOb' // Outlined initializeWithTake global ::= generic-signature? type 'WOc' // Outlined initializeWithCopy global ::= generic-signature? type 'WOC' // Outlined initializeWithCopy, not using value witness diff --git a/include/swift/Demangling/DemangleNodes.def b/include/swift/Demangling/DemangleNodes.def index 51b9042d5337c..421b10a4bde60 100644 --- a/include/swift/Demangling/DemangleNodes.def +++ b/include/swift/Demangling/DemangleNodes.def @@ -400,6 +400,7 @@ NODE(AsyncRemoved) // Added in Swift 5.TBD NODE(ObjectiveCProtocolSymbolicReference) +NODE(OutlinedInitializeWithTakeNoValueWitness) NODE(OutlinedInitializeWithCopyNoValueWitness) NODE(OutlinedAssignWithTakeNoValueWitness) NODE(OutlinedAssignWithCopyNoValueWitness) diff --git a/lib/Demangling/Demangler.cpp b/lib/Demangling/Demangler.cpp index b261d56f22e48..2088c88fdd9e9 100644 --- a/lib/Demangling/Demangler.cpp +++ b/lib/Demangling/Demangler.cpp @@ -3646,6 +3646,15 @@ NodePointer Demangler::demangleWitness() { } case 'O': { switch (nextChar()) { + case 'B': { + if (auto sig = popNode(Node::Kind::DependentGenericSignature)) + return createWithChildren( + Node::Kind::OutlinedInitializeWithTakeNoValueWitness, + popNode(Node::Kind::Type), sig); + return createWithChild( + Node::Kind::OutlinedInitializeWithTakeNoValueWitness, + popNode(Node::Kind::Type)); + } case 'C': { if (auto sig = popNode(Node::Kind::DependentGenericSignature)) return createWithChildren(Node::Kind::OutlinedInitializeWithCopyNoValueWitness, diff --git a/lib/Demangling/NodePrinter.cpp b/lib/Demangling/NodePrinter.cpp index ae7d52243619f..e1b9022d60dc1 100644 --- a/lib/Demangling/NodePrinter.cpp +++ b/lib/Demangling/NodePrinter.cpp @@ -589,6 +589,7 @@ class NodePrinter { case Node::Kind::OutlinedRetain: case Node::Kind::OutlinedRelease: case Node::Kind::OutlinedInitializeWithTake: + case Node::Kind::OutlinedInitializeWithTakeNoValueWitness: case Node::Kind::OutlinedInitializeWithCopy: case Node::Kind::OutlinedAssignWithTake: case Node::Kind::OutlinedAssignWithCopy: @@ -1517,6 +1518,7 @@ NodePointer NodePrinter::print(NodePointer Node, unsigned depth, print(Node->getChild(0), depth + 1); return nullptr; case Node::Kind::OutlinedInitializeWithTake: + case Node::Kind::OutlinedInitializeWithTakeNoValueWitness: Printer << "outlined init with take of "; print(Node->getChild(0), depth + 1); return nullptr; diff --git a/lib/Demangling/OldRemangler.cpp b/lib/Demangling/OldRemangler.cpp index 6013ee0ba39e9..7d1b78750b9b1 100644 --- a/lib/Demangling/OldRemangler.cpp +++ b/lib/Demangling/OldRemangler.cpp @@ -2661,6 +2661,13 @@ ManglingError Remangler::mangleOutlinedDestroy(Node *node, unsigned depth) { Buffer << "Wh"; return mangleSingleChildNode(node, depth + 1); } + +ManglingError +Remangler::mangleOutlinedInitializeWithTakeNoValueWitness(Node *node, + unsigned depth) { + return MANGLING_ERROR(ManglingError::UnsupportedNodeKind, node); +} + ManglingError Remangler::mangleOutlinedInitializeWithCopyNoValueWitness(Node *node, unsigned depth) { return MANGLING_ERROR(ManglingError::UnsupportedNodeKind, node); diff --git a/lib/Demangling/Remangler.cpp b/lib/Demangling/Remangler.cpp index 687357facd5c4..f510491c990b8 100644 --- a/lib/Demangling/Remangler.cpp +++ b/lib/Demangling/Remangler.cpp @@ -3576,6 +3576,14 @@ ManglingError Remangler::mangleOutlinedInitializeWithTake(Node *node, return ManglingError::Success; } +ManglingError +Remangler::mangleOutlinedInitializeWithTakeNoValueWitness(Node *node, + unsigned depth) { + RETURN_IF_ERROR(mangleChildNodes(node, depth + 1)); + Buffer << "WOB"; + return ManglingError::Success; +} + ManglingError Remangler::mangleOutlinedInitializeWithCopy(Node *node, unsigned depth) { RETURN_IF_ERROR(mangleChildNodes(node, depth + 1)); diff --git a/test/Demangle/Inputs/manglings.txt b/test/Demangle/Inputs/manglings.txt index 17d9e400a0c95..65593d300a26d 100644 --- a/test/Demangle/Inputs/manglings.txt +++ b/test/Demangle/Inputs/manglings.txt @@ -298,6 +298,8 @@ _T0SqWOC ---> outlined init with copy of Swift.Optional _T0SqWOD ---> outlined assign with take of Swift.Optional _T0SqWOF ---> outlined assign with copy of Swift.Optional _T0SqWOH ---> outlined destroy of Swift.Optional +_T0SqWOB ---> outlined init with take of Swift.Optional +_T0SqWOb ---> outlined init with take of Swift.Optional _T03nix6testitSaySiGyFTv_ ---> outlined variable #0 of nix.testit() -> [Swift.Int] _T03nix6testitSaySiGyFTv_r ---> outlined read-only object #0 of nix.testit() -> [Swift.Int] _T03nix6testitSaySiGyFTv0_ ---> outlined variable #1 of nix.testit() -> [Swift.Int]