llvmlite
llvmlite copied to clipboard
combine Custom FFI functions with llvmlite
i think llvmlite are not flexible to accept custom ffi functions...
llvmlite use LLVMModuleRef and LLVMValueRef.
but llvmlite python binding class init method are using extra inputs and there are not a way to create just only one LLVMModuleRef ptr or LLVMValueRef ptr.
class ValueRef(ffi.ObjectRef):
"""A weak reference to a LLVM value.
"""
def __init__(self, ptr, kind, parents):
self._kind = kind
self._parents = parents
ffi.ObjectRef.__init__(self, ptr)
in here, i think parameters kind and parents can be removed.
class ModuleRef(ffi.ObjectRef):
"""
A reference to a LLVM module.
"""
def __init__(self, module_ptr, context):
super(ModuleRef, self).__init__(module_ptr)
self._context = context
and also here, i think the parameter context can be removed.
I think If the parameters are removed, it is better.
And what about https://github.com/aguinet/dragonffi ?
oh.. looks really good. but the purpose is different..
@dbwodlf3 thank you for submitting this, I have added it to the queue for review.