Exemplo n.º 1
0
def get(f, argtypes):
    f = jit(f)
    env = environment.fresh_env(f, argtypes, "cpu")
    func, env = phase.typing(f, env)
    context = env['flypy.typing.context']
    signature = env['flypy.typing.signature']
    return func, context, signature
Exemplo n.º 2
0
def get(f, argtypes):
    f = jit(f)
    env = environment.fresh_env(f, argtypes, "cpu")
    func, env = phase.typing(f, env)
    context = env['flypy.typing.context']
    signature = env['flypy.typing.signature']
    return func, context, signature
Exemplo n.º 3
0
def infer_function_call(func, func_type, argtypes, env, flags):
    """
    Method call or flypy function call.
    """
    from flypy.pipeline import phase

    #print(('inferring %s' % func).center(80, '!'))

    if is_method(func_type):
        func = func_type.parameters[0]
        argtypes = [func_type.parameters[1]] + list(argtypes)
    else:
        func = func.const

    # TODO: Support recursion !

    env = env['flypy.fresh_env'](func, argtypes, **flags)
    func, env = phase.typing(func, env)
    # env["flypy.typing.restype"]
    if func_type is None:
        func_type = env["flypy.typing.signature"]
    return func, func_type, env["flypy.typing.restype"]
Exemplo n.º 4
0
def infer_function_call(func, func_type, argtypes, env, flags):
    """
    Method call or flypy function call.
    """
    from flypy.pipeline import phase

    #print(('inferring %s' % func).center(80, '!'))

    if is_method(func_type):
        func = func_type.parameters[0]
        argtypes = [func_type.parameters[1]] + list(argtypes)
    else:
        func = func.const

    # TODO: Support recursion !

    env = env['flypy.fresh_env'](func, argtypes, **flags)
    func, env = phase.typing(func, env)
    # env["flypy.typing.restype"]
    if func_type is None:
        func_type = env["flypy.typing.signature"]
    return func, func_type, env["flypy.typing.restype"]