Skip to content

Commit dd525d0

Browse files
committed
Add requiresOSSACleanup API.
1 parent 0c09d42 commit dd525d0

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

include/swift/SILOptimizer/Utils/OwnershipOptUtils.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,13 @@
2727

2828
namespace swift {
2929

30+
/// Returns true if this value requires OSSA cleanups.
31+
inline bool requiresOSSACleanup(SILValue v) {
32+
return v->getFunction()->hasOwnership()
33+
&& v.getOwnershipKind() != OwnershipKind::None
34+
&& v.getOwnershipKind() != OwnershipKind::Unowned;
35+
}
36+
3037
// Defined in BasicBlockUtils.h
3138
struct JointPostDominanceSetComputer;
3239

0 commit comments

Comments
 (0)