2 from .common
import LLVMObject
3 from .common
import c_object_p
4 from .common
import get_library
5 from . import enumerations
6 from .core
import MemoryBuffer
7 from .core
import Module
8 from .core
import OpCode
9 from ctypes
import POINTER
10 from ctypes
import byref
11 from ctypes
import c_char_p
12 from ctypes
import cast
13 __all__
= ['parse_bitcode']
16 def parse_bitcode(mem_buffer
):
17 """Input is .core.MemoryBuffer"""
19 result
= lib
.LLVMParseBitcode2(mem_buffer
, byref(module
))
21 raise RuntimeError('LLVM Error')
23 m
.take_ownership(mem_buffer
)
26 def register_library(library
):
27 library
.LLVMParseBitcode2
.argtypes
= [MemoryBuffer
, POINTER(c_object_p
)]
28 library
.LLVMParseBitcode2
.restype
= bool