(self, block: Optional['Block'], remove_dead_memdefs=False, stack_pointer_tracker=None,
                 peephole_optimizations: Optional[Iterable[Union[Type[PeepholeOptimizationStmtBase],Type[PeepholeOptimizationExprBase]]]]=None,
                 stack_arg_offsets: Optional[Set[Tuple[int, int]]] = None,
                 )
:param block:   The AIL block to simplify. Setting it to None to skip calling self._analyze(), which is useful
                        in test cases.
:param block:   The AIL block to simplify. Setting it to None to skip calling self._analyze(), which is useful
                        in test cases.
: param block : The AIL block to simplify . Setting it to None to skip calling self . _analyze () which is useful in test cases .
def __init__(self, block: Optional['Block'], remove_dead_memdefs=False, stack_pointer_tracker=None,
                 peephole_optimizations: Optional[Iterable[Union[Type[PeepholeOptimizationStmtBase],Type[PeepholeOptimizationExprBase]]]]=None,
                 stack_arg_offsets: Optional[Set[Tuple[int, int]]] = None,
                 ):
        """
        :param block:   The AIL block to simplify. Setting it to None to skip calling self._analyze(), which is useful
                        in test cases.
        """

        self.block = block

        self._remove_dead_memdefs = remove_dead_memdefs
        self._stack_arg_offsets = stack_arg_offsets
        self._stack_pointer_tracker = stack_pointer_tracker

        if peephole_optimizations is None:
            self._expr_peephole_opts = [ cls(self.project) for cls in EXPR_OPTS ]
            self._stmt_peephole_opts = [ cls(self.project) for cls in STMT_OPTS ]
        else:
            self._expr_peephole_opts = [ cls(self.project) for cls in peephole_optimizations
                                         if issubclass(cls, PeepholeOptimizationExprBase) ]
            self._stmt_peephole_opts = [ cls(self.project) for cls in peephole_optimizations
                                         if issubclass(cls, PeepholeOptimizationStmtBase) ]

        self.result_block = None

        if self.block is not None:
            self._analyze()
def __init__ ( self , block : Optional [ 'Block' ] , remove_dead_memdefs = False , stack_pointer_tracker = None , peephole_optimizations : Optional [ Iterable [ Union [ Type [ PeepholeOptimizationStmtBase ] , Type [ PeepholeOptimizationExprBase ] ] ] ] = None , stack_arg_offsets : Optional [ Set [ Tuple [ int , int ] ] ] = None , ) : self . block = block self . _remove_dead_memdefs = remove_dead_memdefs self . _stack_arg_offsets = stack_arg_offsets self . _stack_pointer_tracker = stack_pointer_tracker if peephole_optimizations is None : self . _expr_peephole_opts = [ cls ( self . project ) for cls in EXPR_OPTS ] self . _stmt_peephole_opts = [ cls ( self . project ) for cls in STMT_OPTS ] else : self . _expr_peephole_opts = [ cls ( self . project ) for cls in peephole_optimizations if issubclass ( cls , PeepholeOptimizationExprBase ) ] self . _stmt_peephole_opts = [ cls ( self . project ) for cls in peephole_optimizations if issubclass ( cls , PeepholeOptimizationStmtBase ) ] self . result_block = None if self . block is not None : self . _analyze ( )