Skip to content

Commit ef2625a

Browse files
committed
Added accessor for a context on an IRType
1 parent d774949 commit ef2625a

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
@@ -30,6 +30,11 @@ public extension IRType {
3030
return LLVMConstPointerNull(asLLVM())
3131
}
3232

33+
/// Returns the context associated with this type
34+
public func context() -> Context {
35+
return Context(llvm: LLVMGetTypeContext(asLLVM()))
36+
}
37+
3338
/// Dumps a representation of this type to stderr.
3439
public func dump() {
3540
LLVMDumpType(asLLVM())

0 commit comments

Comments
 (0)