Skip to content

Commit d0ac094

Browse files
committed
Bridge MarkDependence.resolveToNonEscaping
1 parent f713587 commit d0ac094

File tree

4 files changed

+14
-0
lines changed

4 files changed

+14
-0
lines changed

SwiftCompilerSources/Sources/SIL/Instruction.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -937,6 +937,10 @@ class MarkDependenceInst : SingleValueInstruction, ForwardingInstruction {
937937
}
938938
public var isNonEscaping: Bool { dependenceKind == .NonEscaping }
939939
public var isUnresolved: Bool { dependenceKind == .Unresolved }
940+
941+
public func resolveToNonEscaping() {
942+
bridged.MarkDependenceInst_resolveToNonEscaping()
943+
}
940944
}
941945

942946
final public class RefToBridgeObjectInst : SingleValueInstruction, ForwardingInstruction {

include/swift/SIL/SILBridging.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -874,6 +874,7 @@ struct BridgedInstruction {
874874
BRIDGED_INLINE SwiftInt StoreInst_getStoreOwnership() const;
875875
BRIDGED_INLINE SwiftInt AssignInst_getAssignOwnership() const;
876876
BRIDGED_INLINE MarkDependenceKind MarkDependenceInst_dependenceKind() const;
877+
BRIDGED_INLINE void MarkDependenceInst_resolveToNonEscaping() const;
877878
BRIDGED_INLINE AccessKind BeginAccessInst_getAccessKind() const;
878879
BRIDGED_INLINE bool BeginAccessInst_isStatic() const;
879880
BRIDGED_INLINE bool CopyAddrInst_isTakeOfSrc() const;

include/swift/SIL/SILBridgingImpl.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1118,6 +1118,10 @@ BridgedInstruction::MarkDependenceKind BridgedInstruction::MarkDependenceInst_de
11181118
return (MarkDependenceKind)getAs<swift::MarkDependenceInst>()->dependenceKind();
11191119
}
11201120

1121+
void BridgedInstruction::MarkDependenceInst_resolveToNonEscaping() const {
1122+
getAs<swift::MarkDependenceInst>()->resolveToNonEscaping();
1123+
}
1124+
11211125
BridgedInstruction::AccessKind BridgedInstruction::BeginAccessInst_getAccessKind() const {
11221126
return (AccessKind)getAs<swift::BeginAccessInst>()->getAccessKind();
11231127
}

include/swift/SIL/SILInstruction.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8440,6 +8440,11 @@ class MarkDependenceInst
84408440
return dependenceKind() == MarkDependenceKind::Unresolved;
84418441
}
84428442

8443+
void resolveToNonEscaping() {
8444+
sharedUInt8().MarkDependenceInst.dependenceKind =
8445+
uint8_t(MarkDependenceKind::NonEscaping);
8446+
}
8447+
84438448
/// Visit the instructions that end the lifetime of an OSSA on-stack closure.
84448449
bool visitNonEscapingLifetimeEnds(llvm::function_ref<bool (Operand*)> func)
84458450
const;

0 commit comments

Comments
 (0)