def _compile(context, func, ret_type=None, arg_types=None, **kwds): """ Compile a numba annotated function. - decompile function into a Python ast - run type inference using the given input types - compile the function to LLVM """ ast = _get_ast(func) func_signature = minitypes.FunctionType(return_type=ret_type, args=arg_types) func_signature, symtab, ast = type_inference._infer_types( context, func, ast, func_signature) func_name = naming.specialized_mangle(func.__name__, func_signature.args) t = translate.LLVMCodeGenerator(context, func, ast, func_signature=func_signature, func_name=func_name, symtab=symtab, **kwds) t.translate() return func_signature, t.lfunc, t.get_ctypes_func(kwds.get('llvm', True))
def infer(func, arg_types): sig = minitypes.FunctionType(return_type=None, args=arg_types) ast = functions._get_ast(func) sig, symtab, ast = ast_type_inference._infer_types( decorators.context, func, ast, sig) return sig, symtab
def infer(func, arg_types): sig = minitypes.FunctionType(return_type=None, args=arg_types) ast = functions._get_ast(func) sig, symtab, ast = ast_type_inference._infer_types(decorators.context, func, ast, sig) return sig, symtab
def _compile(context, func, ret_type=None, arg_types=None, **kwds): """ Compile a numba annotated function. - decompile function into a Python ast - run type inference using the given input types - compile the function to LLVM """ ast = _get_ast(func) func_signature = minitypes.FunctionType(return_type=ret_type, args=arg_types) func_signature, symtab, ast = type_inference._infer_types( context, func, ast, func_signature) func_name = naming.specialized_mangle(func.__name__, func_signature.args) t = translate.LLVMCodeGenerator( context, func, ast, func_signature=func_signature, func_name=func_name, symtab=symtab, **kwds) t.translate() return func_signature, t.lfunc, t.get_ctypes_func(kwds.get('llvm', True))
def _infer_types(context, func, ret_type=None, arg_types=None): ast = _get_ast(func) func_signature = minitypes.FunctionType(return_type=ret_type, args=arg_types) return type_inference._infer_types(context, func, ast, func_signature)