示例#1
0
def _do_if_to_phi(func, *phi_args):
    for dec in (
            begin_rewrite(),
            if_to_phi(*phi_args),
            end_rewrite()):
        func = dec(func)
    return func
示例#2
0
def _do_inline(func, **kwargs):
    for dec in (
            begin_rewrite(),
            debug(**kwargs),
            if_inline(),
            debug(**kwargs),
            end_rewrite()):
        func = dec(func)
    return func
示例#3
0
文件: family.py 项目: sillycross/peak
 def deco(cls):
     if not self._passes:
         return cls
     # only rewrite if necesarry
     call = cls.__call__
     call = begin_rewrite(env=env)(call)
     for dec in self._passes:
         call = dec(call)
     call = end_rewrite()(call)
     cls.__call__ = call
     return cls
示例#4
0
def _do_ssa(func, strict, **kwargs):
    for dec in (begin_rewrite(), debug(**kwargs), ssa(strict), debug(**kwargs),
                end_rewrite()):
        func = dec(func)
    return func