Skip to content

Commit 151d275

Browse files
committed
[sil] Add helper DestructureStruct::getStructDecl().
StructExtract has a similar routine, so it makes sense to add it to destructure struct as well.
1 parent 4ad2bc9 commit 151d275

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

include/swift/SIL/SILInstruction.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10302,6 +10302,11 @@ class DestructureStructInst final
1030210302
static DestructureStructInst *
1030310303
create(const SILFunction &F, SILDebugLocation Loc, SILValue Operand,
1030410304
ValueOwnershipKind forwardingOwnershipKind);
10305+
10306+
StructDecl *getStructDecl() const {
10307+
return getOperand()->getType().getStructOrBoundGenericStruct();
10308+
}
10309+
1030510310
static bool classof(SILNodePointer node) {
1030610311
return node->getKind() == SILNodeKind::DestructureStructInst;
1030710312
}

0 commit comments

Comments
 (0)