We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
UseList.isSingleUse
1 parent dd5d5f9 commit 7c71f00Copy full SHA for 7c71f00
SwiftCompilerSources/Sources/SIL/Operand.swift
@@ -99,13 +99,16 @@ public struct UseList : CollectionLikeSequence {
99
self.firstOpPtr = firstOpPtr.op
100
}
101
102
- public var isSingleUse: Bool {
+ public var singleUse: Operand? {
103
if let opPtr = firstOpPtr {
104
- return Operand_nextUse(BridgedOperand(op: opPtr)).op == nil
+ if Operand_nextUse(BridgedOperand(op: opPtr)).op != nil { return nil }
105
+ return Operand(BridgedOperand(op: opPtr))
106
- return false
107
+ return nil
108
109
110
+ public var isSingleUse: Bool { singleUse != nil }
111
+
112
public func makeIterator() -> Iterator {
113
return Iterator(currentOpPtr: firstOpPtr)
114
0 commit comments