qute-0.1.0: A software analysis framework built around the QBE intermediate language.
Safe HaskellNone
LanguageGHC2021

Language.QBE.Analysis.CDG

Description

This module implements a control dependency analysis, using a control dependency graph (CDG) for more information on the concept refer to https://doi.org/10.1145/24039.24041. Roughly speaking, a node A is control dependent on B if there is an edge B → A so that the node is taken, as well as an edge so that it is not taken.

Synopsis

Documentation

data CDG Source #

A CDG signifying control-dependence between nodes in the CFG.

Constructors

CDG 

Fields

build :: CFG -> Label -> CDG Source #

Construct a new CDG from an existing CFG. The CDG is build based on the given Label from the CFG, which is used to as the root of a post-dominator tree to establish a post-dominance relationship between nodes.

edges :: CDG -> [(Label, Label)] Source #

All edges of the CDG, in an unspecified order.

ctrlDeps :: CDG -> Label -> Maybe IntSet Source #

Returns the control dependencies of a given node in the CFG. If the node doesn't have any control dependencies, Nothing is returned.