(self)
Construct a control dependence graph.

        This implementation is based on figure 6 of paper An Efficient Method of Computing Static Single Assignment
        Form by Ron Cytron, etc.
Construct a control dependence graph.
Construct a control dependence graph .
def _construct(self):
        """
        Construct a control dependence graph.

        This implementation is based on figure 6 of paper An Efficient Method of Computing Static Single Assignment
        Form by Ron Cytron, etc.
        """

        if not self._cfg._model.ident.startswith('CFGEmulated'):
            raise ValueError("CDG is only supported by CFGEmulated.")

        self._acyclic_cfg = self._cfg.copy()
        # TODO: Cycle-removing is not needed - confirm it later
        # The CFG we use should be acyclic!
        #self._acyclic_cfg.remove_cycles()

        # Pre-process the acyclic CFG
        self._pre_process_cfg()

        # Construct post-dominator tree
        self._pd_construct()

        self._graph: networkx.DiGraph  = networkx.DiGraph()

        # Construct the reversed dominance frontier mapping
        rdf = compute_dominance_frontier(self._normalized_cfg, self._post_dom)

        for y in self._cfg.graph.nodes():
            if y not in rdf:
                continue
            for x in rdf[y]:
                self._graph.add_edge(x, y)
def _construct ( self ) : if not self . _cfg . _model . ident . startswith ( 'CFGEmulated' ) : raise ValueError ( "CDG is only supported by CFGEmulated." ) self . _acyclic_cfg = self . _cfg . copy ( ) # TODO: Cycle-removing is not needed - confirm it later # The CFG we use should be acyclic! #self._acyclic_cfg.remove_cycles() # Pre-process the acyclic CFG self . _pre_process_cfg ( ) # Construct post-dominator tree self . _pd_construct ( ) self . _graph : networkx . DiGraph = networkx . DiGraph ( ) # Construct the reversed dominance frontier mapping rdf = compute_dominance_frontier ( self . _normalized_cfg , self . _post_dom ) for y in self . _cfg . graph . nodes ( ) : if y not in rdf : continue for x in rdf [ y ] : self . _graph . add_edge ( x , y )