Skip to content

Commit edf0ba0

Browse files
committed
libswift: add UseList.isSingleUse property
1 parent 56cfab2 commit edf0ba0

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

libswift/Sources/SIL/Operand.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,13 @@ public struct UseList : Sequence, CustomReflectable {
9999
self.firstOpPtr = firstOpPtr.op
100100
}
101101

102+
public var isSingleUse: Bool {
103+
if let opPtr = firstOpPtr {
104+
return Operand_nextUse(BridgedOperand(op: opPtr)).op == nil
105+
}
106+
return false
107+
}
108+
102109
public func makeIterator() -> Iterator {
103110
return Iterator(currentOpPtr: firstOpPtr)
104111
}

0 commit comments

Comments
 (0)