示例#1
0
 def check_syntax(ovfblock, block=None):
     """check whether ovfblock is reachable more than once
     or if they cheated about the argument"""
     if block:
         link = block.exits[0]
         for lprev, ltarg in zip(link.args, ovfblock.inputargs):
             renaming[ltarg] = rename(lprev)
         arg = ovfblock.operations[0].args[-1]
         res = block.operations[-1].result
         opname = block.operations[-1].opname
     else:
         arg = ovfblock.operations[-1].args[-1]
         res = ovfblock.operations[-2].result
         opname = ovfblock.operations[-2].opname
     if rename(arg) != rename(res) or ovfblock in seen_ovfblocks:
         raise SyntaxError("ovfcheck in %s: The checked operation %s" " is misplaced" % (graph.name, opname))
     exlis = implicit_exceptions.get("%s_%s" % (opname, appendix), [])
     if OverflowError not in exlis:
         raise SyntaxError("ovfcheck in %s: Operation %s has no" " overflow variant" % (graph.name, opname))
示例#2
0
 def check_syntax(ovfblock, block=None):
     """check whether ovfblock is reachable more than once
     or if they cheated about the argument"""
     if block:
         link = block.exits[0]
         for lprev, ltarg in zip(link.args, ovfblock.inputargs):
             renaming[ltarg] = rename(lprev)
         arg = ovfblock.operations[0].args[-1]
         res = block.operations[-1].result
         opname = block.operations[-1].opname
     else:
         arg = ovfblock.operations[-1].args[-1]
         res = ovfblock.operations[-2].result
         opname = ovfblock.operations[-2].opname
     if rename(arg) != rename(res) or ovfblock in seen_ovfblocks:
         raise SyntaxError("ovfcheck in %s: The checked operation %s"
                           " is misplaced" % (graph.name, opname))
     exlis = implicit_exceptions.get("%s_%s" % (opname, appendix), [])
     if OverflowError not in exlis:
         raise SyntaxError("ovfcheck in %s: Operation %s has no"
                           " overflow variant" % (graph.name, opname))
示例#3
0
文件: simplify.py 项目: alkorzt/pypy
 def check_syntax(opname):
     exlis = implicit_exceptions.get("%s_ovf" % (opname,), [])
     if OverflowError not in exlis:
         raise Exception("ovfcheck in %s: Operation %s has no"
                         " overflow variant" % (graph.name, opname))
示例#4
0
 def check_syntax(opname):
     exlis = implicit_exceptions.get("%s_ovf" % (opname, ), [])
     if OverflowError not in exlis:
         raise Exception("ovfcheck in %s: Operation %s has no"
                         " overflow variant" % (graph.name, opname))