File tree Expand file tree Collapse file tree 1 file changed +19
-14
lines changed Expand file tree Collapse file tree 1 file changed +19
-14
lines changed Original file line number Diff line number Diff line change 1
1
import cllvm
2
2
3
+ /// `Use` represents an iterator over the uses and users of a particular value
4
+ /// in an LLVM program.
3
5
public struct Use {
4
- internal let llvm : LLVMUseRef
5
-
6
- public func next( ) -> Use ? {
7
- guard let next = LLVMGetNextUse ( llvm) else { return nil }
8
- return Use ( llvm: next)
9
- }
10
-
11
- public func user( ) -> IRValue ? {
12
- return LLVMGetUser ( llvm)
13
- }
14
-
15
- public func usedValue( ) -> IRValue ? {
16
- return LLVMGetUsedValue ( llvm)
17
- }
6
+ internal let llvm : LLVMUseRef
7
+
8
+ /// Retrieves the next use of a value.
9
+ public func next( ) -> Use ? {
10
+ guard let next = LLVMGetNextUse ( llvm) else { return nil }
11
+ return Use ( llvm: next)
12
+ }
13
+
14
+ /// Obtain the user value for this `User` object.
15
+ public func user( ) -> IRValue ? {
16
+ return LLVMGetUser ( llvm)
17
+ }
18
+
19
+ /// Obtain the value this `User` object corresponds to.
20
+ public func usedValue( ) -> IRValue ? {
21
+ return LLVMGetUsedValue ( llvm)
22
+ }
18
23
}
You can’t perform that action at this time.
0 commit comments