File tree Expand file tree Collapse file tree 2 files changed +23
-18
lines changed Expand file tree Collapse file tree 2 files changed +23
-18
lines changed Original file line number Diff line number Diff line change @@ -104,8 +104,8 @@ public final class Module {
104
104
}
105
105
}
106
106
107
- /// Creates a type with the given name in this module if that name does not
108
- /// conflict with an existing type name .
107
+ /// Searches for and retrieves a type with the given name in this module if
108
+ /// that name references an existing type.
109
109
///
110
110
/// - parameter name: The name of the type to create.
111
111
///
@@ -116,8 +116,8 @@ public final class Module {
116
116
return convertType ( type)
117
117
}
118
118
119
- /// Creates a function with the given name in this module if that name does
120
- /// not conflict with an existing type name .
119
+ /// Searches for and retrieves a function with the given name in this module
120
+ /// if that name references an existing function .
121
121
///
122
122
/// - parameter name: The name of the function to create.
123
123
///
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