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))
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))
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))