Example #1
0
 def interpret(self, fn, args):
     interp, graph = get_interpreter(fn, args, view=False, viewbefore=False, type_system=self.type_system)
     if option.view:
         interp.typer.annotator.translator.view()
     build_trees(graph)
     if option.view:
         interp.typer.annotator.translator.view()
     return interp.eval_graph(graph, args)
Example #2
0
 def interpret(self, fn, args):
     interp, graph = get_interpreter(fn,
                                     args,
                                     view=False,
                                     viewbefore=False,
                                     type_system=self.type_system)
     if option.view:
         interp.typer.annotator.translator.view()
     build_trees(graph)
     if option.view:
         interp.typer.annotator.translator.view()
     return interp.eval_graph(graph, args)
Example #3
0
def check_trees(func, argtypes, backendopt=False):
    t = translate(func, argtypes, backendopt=backendopt)
    if option.view:
        t.view()
    graph = graphof(t, func)
    build_trees(graph)
    if option.view:
        t.view()
    interp = LLInterpreter(t.rtyper)
    def eval_func(*args):
        return interp.eval_graph(graph, args)
    return graph, eval_func
Example #4
0
def check_trees(func, argtypes, backendopt=False):
    t = translate(func, argtypes, backendopt=backendopt)
    if option.view:
        t.view()
    graph = graphof(t, func)
    build_trees(graph)
    if option.view:
        t.view()
    interp = LLInterpreter(t.rtyper)

    def eval_func(*args):
        return interp.eval_graph(graph, args)

    return graph, eval_func
Example #5
0
 def stack_optimization(self):
     for graph in self.translator.graphs:
         SSI_to_SSA(graph)
         build_trees(graph)