llvmlite icon indicating copy to clipboard operation
llvmlite copied to clipboard

combine Custom FFI functions with llvmlite

Open dbwodlf3 opened this issue 4 years ago • 3 comments

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.

dbwodlf3 avatar Dec 27 '20 23:12 dbwodlf3

And what about https://github.com/aguinet/dragonffi ?

advancedwebdeveloper avatar Dec 28 '20 00:12 advancedwebdeveloper

oh.. looks really good. but the purpose is different..

dbwodlf3 avatar Dec 29 '20 05:12 dbwodlf3

@dbwodlf3 thank you for submitting this, I have added it to the queue for review.

esc avatar Jan 05 '21 11:01 esc