(self, function, data_graph)
:param function:
        :param networkx.MultiDiGraph data_graph:
        :return:
def _constant_propagation(self, function, data_graph):  #pylint:disable=unused-argument
        """

        :param function:
        :param networkx.MultiDiGraph data_graph:
        :return:
        """

        # find all edge sequences that looks like const->reg->memory

        for n0 in data_graph.nodes():
            if not isinstance(n0.variable, SimConstantVariable):
                continue

            n1s = list(data_graph.successors(n0))
            if len(n1s) != 1:
                continue
            n1 = n1s[0]

            if not isinstance(n1.variable, SimRegisterVariable):
                continue
            if len(list(data_graph.predecessors(n1))) != 1:
                continue

            n2s = list(data_graph.successors(n1))
            if len(n2s) != 1:
                continue
            n2 = n2s[0]

            if not isinstance(n2.variable, SimMemoryVariable):
                continue
            n2_inedges = data_graph.in_edges(n2, data=True)
            if len([ 0 for _, _, data in n2_inedges if 'type' in data and data['type'] == 'mem_data' ]) != 1:
                continue

            cp = ConstantPropagation(n0.variable.value, n0.location, n2.location)
            self.constant_propagations.append(cp)
def _constant_propagation ( self , function , data_graph ) : #pylint:disable=unused-argument # find all edge sequences that looks like const->reg->memory for n0 in data_graph . nodes ( ) : if not isinstance ( n0 . variable , SimConstantVariable ) : continue n1s = list ( data_graph . successors ( n0 ) ) if len ( n1s ) != 1 : continue n1 = n1s [ 0 ] if not isinstance ( n1 . variable , SimRegisterVariable ) : continue if len ( list ( data_graph . predecessors ( n1 ) ) ) != 1 : continue n2s = list ( data_graph . successors ( n1 ) ) if len ( n2s ) != 1 : continue n2 = n2s [ 0 ] if not isinstance ( n2 . variable , SimMemoryVariable ) : continue n2_inedges = data_graph . in_edges ( n2 , data = True ) if len ( [ 0 for _ , _ , data in n2_inedges if 'type' in data and data [ 'type' ] == 'mem_data' ] ) != 1 : continue cp = ConstantPropagation ( n0 . variable . value , n0 . location , n2 . location ) self . constant_propagations . append ( cp )