Skip to content

Commit 56b89e2

Browse files
committed
Added accessor for a context on an IRType
1 parent 865e622 commit 56b89e2

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Sources/LLVM/IRType.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@ public extension IRType {
2929
public func constPointerNull() -> IRValue {
3030
return LLVMConstPointerNull(asLLVM())
3131
}
32+
33+
/// Returns the context associated with this type
34+
public func context() -> Context {
35+
return Context(llvm: LLVMGetTypeContext(asLLVM()))
36+
}
3237
}
3338

3439
internal func convertType(_ type: LLVMTypeRef) -> IRType {

0 commit comments

Comments
 (0)