mirror of
https://github.com/RPCS3/llvm.git
synced 2026-07-19 23:23:38 -04:00
Deprecate a few C APIs.
This deprecates: * LLVMParseBitcode * LLVMParseBitcodeInContext * LLVMGetBitcodeModuleInContext * LLVMGetBitcodeModule They are replaced with the functions with a 2 suffix which do not record a diagnostic. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256065 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -16,16 +16,15 @@ lib = get_library()
|
||||
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)
|
||||
|
||||
Reference in New Issue
Block a user