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.
1 parent 5a0353f commit 98580c4Copy full SHA for 98580c4
Sources/LLVM/LabelType.swift
@@ -4,11 +4,23 @@ import cllvm
4
5
/// `LabelType` represents code labels.
6
public struct LabelType: IRType {
7
+
8
+ /// Returns the context associated with this module.
9
+ public let context: Context?
10
11
/// Creates a code label.
- public init() {}
12
+ ///
13
+ /// - parameter context: The context to create this type in
14
+ /// - SeeAlso: http://llvm.org/docs/ProgrammersManual.html#achieving-isolation-with-llvmcontext
15
+ public init(context: Context? = nil) {
16
+ self.context = context
17
+ }
18
19
/// Retrieves the underlying LLVM type object.
20
public func asLLVM() -> LLVMTypeRef {
21
+ if let context = context {
22
+ return LLVMLabelTypeInContext(context.llvm)
23
24
return LLVMLabelType()
25
}
26
0 commit comments