Author: Ronan Lamy <ronan.l...@gmail.com> Branch: framestate Changeset: r75923:dae9c828b3d3 Date: 2015-02-15 02:40 +0000 http://bitbucket.org/pypy/pypy/changeset/dae9c828b3d3/
Log: delete unused FlowSignals diff --git a/rpython/flowspace/bytecode.py b/rpython/flowspace/bytecode.py --- a/rpython/flowspace/bytecode.py +++ b/rpython/flowspace/bytecode.py @@ -138,7 +138,6 @@ except KeyError: return GenericOpcode(self.opnames[opnum], opnum, arg, offset) - def _iter_instr(self, code): self.offset = 0 i = 0 diff --git a/rpython/flowspace/flowcontext.py b/rpython/flowspace/flowcontext.py --- a/rpython/flowspace/flowcontext.py +++ b/rpython/flowspace/flowcontext.py @@ -1010,17 +1010,6 @@ return type(other) is type(self) and other.args == self.args -class Return(FlowSignal): - """Signals a 'return' statement. """ - @property - def args(self): - return [] - - @staticmethod - def rebuild(): - return Return() - - class Raise(FlowSignal): """Signals an application-level exception (i.e. an OperationException).""" @@ -1061,35 +1050,6 @@ raise StopFlowing -class Break(FlowSignal): - """Signals a 'break' statement.""" - - @property - def args(self): - return [] - - @staticmethod - def rebuild(): - return Break.singleton - -Break.singleton = Break() - -class Continue(FlowSignal): - """Signals a 'continue' statement. - Argument is the bytecode position of the beginning of the loop.""" - - def __init__(self, jump_to): - self.jump_to = jump_to - - @property - def args(self): - return [const(self.jump_to)] - - @staticmethod - def rebuild(w_jump_to): - return Continue(w_jump_to.value) - - class FrameBlock(object): """Abstract base class for frame blocks from the blockstack, used by the SETUP_XXX and POP_BLOCK opcodes.""" @@ -1117,7 +1077,7 @@ class LoopBlock(FrameBlock): """A loop block. Stores the end-of-loop pointer in case of 'break'.""" - handles = (Break, Continue) + handles = type(None) class ExceptBlock(FrameBlock): """An try:except: block. Stores the position of the exception handler.""" diff --git a/rpython/flowspace/test/test_flowcontext.py b/rpython/flowspace/test/test_flowcontext.py --- a/rpython/flowspace/test/test_flowcontext.py +++ b/rpython/flowspace/test/test_flowcontext.py @@ -2,14 +2,11 @@ import pytest from rpython.flowspace.model import Variable, FSException from rpython.flowspace.flowcontext import ( - Return, Raise, RaiseImplicit, Continue, Break) + Raise, RaiseImplicit) @pytest.mark.parametrize('signal', [ - Return(), Raise(FSException(Variable(), Variable())), RaiseImplicit(FSException(Variable(), Variable())), - Break(), - Continue(42), ]) def test_signals(signal): assert signal.rebuild(*signal.args) == signal _______________________________________________ pypy-commit mailing list pypy-commit@python.org https://mail.python.org/mailman/listinfo/pypy-commit