Exemple #1
0
def compile_to_ir(func):
    func_ir = run_frontend(func)
    state = StateDict()
    state.func_ir = func_ir
    state.typemap = None
    state.calltypes = None

    # call this to get print etc rewrites
    rewrites.rewrite_registry.apply('before-inference', state)
    return func_ir
Exemple #2
0
 def __init__(self, typingctx, targetctx, args, f_ir):
     from numba.core.compiler import StateDict
     self.state = StateDict()
     self.state.typingctx = typingctx
     self.state.targetctx = targetctx
     self.state.args = args
     self.state.func_ir = f_ir
     self.state.typemap = None
     self.state.return_type = None
     self.state.calltypes = None