Skip to content

Commit 1e46328

Browse files
authored
Merge pull request #82066 from xedin/rdar-152665294-6.2
[6.2][Demangle] Implement missing `Node::Kind::OutlinedInitializeWithTakeNoValueWitness`
2 parents 2e368ce + fd79a85 commit 1e46328

File tree

7 files changed

+30
-0
lines changed

7 files changed

+30
-0
lines changed

docs/ABI/Mangling.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,7 @@ with a differentiable function used for differentiable programming.
331331
global ::= generic-signature? type 'WOe' // Outlined consume
332332
global ::= generic-signature? type 'WOr' // Outlined retain
333333
global ::= generic-signature? type 'WOs' // Outlined release
334+
global ::= generic-signature? type 'WOB' // Outlined initializeWithTake, not using value witness
334335
global ::= generic-signature? type 'WOb' // Outlined initializeWithTake
335336
global ::= generic-signature? type 'WOc' // Outlined initializeWithCopy
336337
global ::= generic-signature? type 'WOC' // Outlined initializeWithCopy, not using value witness

include/swift/Demangling/DemangleNodes.def

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -400,6 +400,7 @@ NODE(AsyncRemoved)
400400
// Added in Swift 5.TBD
401401
NODE(ObjectiveCProtocolSymbolicReference)
402402

403+
NODE(OutlinedInitializeWithTakeNoValueWitness)
403404
NODE(OutlinedInitializeWithCopyNoValueWitness)
404405
NODE(OutlinedAssignWithTakeNoValueWitness)
405406
NODE(OutlinedAssignWithCopyNoValueWitness)

lib/Demangling/Demangler.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3646,6 +3646,15 @@ NodePointer Demangler::demangleWitness() {
36463646
}
36473647
case 'O': {
36483648
switch (nextChar()) {
3649+
case 'B': {
3650+
if (auto sig = popNode(Node::Kind::DependentGenericSignature))
3651+
return createWithChildren(
3652+
Node::Kind::OutlinedInitializeWithTakeNoValueWitness,
3653+
popNode(Node::Kind::Type), sig);
3654+
return createWithChild(
3655+
Node::Kind::OutlinedInitializeWithTakeNoValueWitness,
3656+
popNode(Node::Kind::Type));
3657+
}
36493658
case 'C': {
36503659
if (auto sig = popNode(Node::Kind::DependentGenericSignature))
36513660
return createWithChildren(Node::Kind::OutlinedInitializeWithCopyNoValueWitness,

lib/Demangling/NodePrinter.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -589,6 +589,7 @@ class NodePrinter {
589589
case Node::Kind::OutlinedRetain:
590590
case Node::Kind::OutlinedRelease:
591591
case Node::Kind::OutlinedInitializeWithTake:
592+
case Node::Kind::OutlinedInitializeWithTakeNoValueWitness:
592593
case Node::Kind::OutlinedInitializeWithCopy:
593594
case Node::Kind::OutlinedAssignWithTake:
594595
case Node::Kind::OutlinedAssignWithCopy:
@@ -1517,6 +1518,7 @@ NodePointer NodePrinter::print(NodePointer Node, unsigned depth,
15171518
print(Node->getChild(0), depth + 1);
15181519
return nullptr;
15191520
case Node::Kind::OutlinedInitializeWithTake:
1521+
case Node::Kind::OutlinedInitializeWithTakeNoValueWitness:
15201522
Printer << "outlined init with take of ";
15211523
print(Node->getChild(0), depth + 1);
15221524
return nullptr;

lib/Demangling/OldRemangler.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2661,6 +2661,13 @@ ManglingError Remangler::mangleOutlinedDestroy(Node *node, unsigned depth) {
26612661
Buffer << "Wh";
26622662
return mangleSingleChildNode(node, depth + 1);
26632663
}
2664+
2665+
ManglingError
2666+
Remangler::mangleOutlinedInitializeWithTakeNoValueWitness(Node *node,
2667+
unsigned depth) {
2668+
return MANGLING_ERROR(ManglingError::UnsupportedNodeKind, node);
2669+
}
2670+
26642671
ManglingError Remangler::mangleOutlinedInitializeWithCopyNoValueWitness(Node *node,
26652672
unsigned depth) {
26662673
return MANGLING_ERROR(ManglingError::UnsupportedNodeKind, node);

lib/Demangling/Remangler.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3576,6 +3576,14 @@ ManglingError Remangler::mangleOutlinedInitializeWithTake(Node *node,
35763576
return ManglingError::Success;
35773577
}
35783578

3579+
ManglingError
3580+
Remangler::mangleOutlinedInitializeWithTakeNoValueWitness(Node *node,
3581+
unsigned depth) {
3582+
RETURN_IF_ERROR(mangleChildNodes(node, depth + 1));
3583+
Buffer << "WOB";
3584+
return ManglingError::Success;
3585+
}
3586+
35793587
ManglingError Remangler::mangleOutlinedInitializeWithCopy(Node *node,
35803588
unsigned depth) {
35813589
RETURN_IF_ERROR(mangleChildNodes(node, depth + 1));

test/Demangle/Inputs/manglings.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,8 @@ _T0SqWOC ---> outlined init with copy of Swift.Optional
298298
_T0SqWOD ---> outlined assign with take of Swift.Optional
299299
_T0SqWOF ---> outlined assign with copy of Swift.Optional
300300
_T0SqWOH ---> outlined destroy of Swift.Optional
301+
_T0SqWOB ---> outlined init with take of Swift.Optional
302+
_T0SqWOb ---> outlined init with take of Swift.Optional
301303
_T03nix6testitSaySiGyFTv_ ---> outlined variable #0 of nix.testit() -> [Swift.Int]
302304
_T03nix6testitSaySiGyFTv_r ---> outlined read-only object #0 of nix.testit() -> [Swift.Int]
303305
_T03nix6testitSaySiGyFTv0_ ---> outlined variable #1 of nix.testit() -> [Swift.Int]

0 commit comments

Comments
 (0)