def parse_bitcode(mem_buffer):
"""Input is .core.MemoryBuffer"""
module = c_object_p()
- out = c_char_p(None)
- result = lib.LLVMParseBitcode(mem_buffer, byref(module), byref(out))
+ result = lib.LLVMParseBitcode2(mem_buffer, byref(module))
if result:
- raise RuntimeError('LLVM Error: %s' % out.value)
+ raise RuntimeError('LLVM Error')
m = Module(module)
m.take_ownership(mem_buffer)
return m
def register_library(library):
- library.LLVMParseBitcode.argtypes = [MemoryBuffer, POINTER(c_object_p), POINTER(c_char_p)]
- library.LLVMParseBitcode.restype = bool
+ library.LLVMParseBitcode2.argtypes = [MemoryBuffer, POINTER(c_object_p)]
+ library.LLVMParseBitcode2.restype = bool
register_library(lib)