| ... | ... | @@ -17,6 +17,14 @@ pub const Bool = enum(c_int) { |
| 17 | 17 | }; |
| 18 | 18 | pub const AttributeIndex = c_uint; |
| 19 | 19 | |
| 20 | pub const MemoryBuffer = opaque { |
| 21 | pub const createMemoryBufferWithMemoryRange = LLVMCreateMemoryBufferWithMemoryRange; |
| 22 | pub const dispose = LLVMDisposeMemoryBuffer; |
| 23 | |
| 24 | extern fn LLVMCreateMemoryBufferWithMemoryRange(InputData: [*]const u8, InputDataLength: usize, BufferName: ?[*:0]const u8, RequiresNullTerminator: Bool) *MemoryBuffer; |
| 25 | extern fn LLVMDisposeMemoryBuffer(MemBuf: *MemoryBuffer) void; |
| 26 | }; |
| 27 | |
| 20 | 28 | /// Make sure to use the *InContext functions instead of the global ones. |
| 21 | 29 | pub const Context = opaque { |
| 22 | 30 | pub const create = LLVMContextCreate; |
| ... | ... | @@ -25,6 +33,9 @@ pub const Context = opaque { |
| 25 | 33 | pub const dispose = LLVMContextDispose; |
| 26 | 34 | extern fn LLVMContextDispose(C: *Context) void; |
| 27 | 35 | |
| 36 | pub const parseBitcodeInContext2 = LLVMParseBitcodeInContext2; |
| 37 | extern fn LLVMParseBitcodeInContext2(C: *Context, MemBuf: *MemoryBuffer, OutModule: **Module) Bool; |
| 38 | |
| 28 | 39 | pub const createEnumAttribute = LLVMCreateEnumAttribute; |
| 29 | 40 | extern fn LLVMCreateEnumAttribute(C: *Context, KindID: c_uint, Val: u64) *Attribute; |
| 30 | 41 | |