llvm-analysis-0.3.0: A Haskell library for analyzing LLVM bitcode

Safe HaskellNone

LLVM.Analysis.CFG

Contents

Description

This module defines control flow graphs over the LLVM IR.

Synopsis

Types

data CFG Source

The type of function control flow graphs.

Instances

Eq CFG

This instance does not compare the graphs directly - instead it compares just the function from which the graph is constructed. The construction is completely deterministic so this should be fine. It is also fast because function comparison just compares unique integer IDs.

HasFunction CFG 
ToGraphviz CFG 
FuncLike CFG 
HasCFG CFG 
HasPostdomTree CFG

Note that this instance constructs the postdominator tree from scratch.

HasDomTree CFG

Note, this instance constructs the dominator tree and could be expensive

class HasCFG a whereSource

A class for things from which a CFG can be obtained.

Methods

getCFG :: a -> CFGSource

Constructors

controlFlowGraph :: Function -> CFGSource

Create a CFG for a function

Accessors

basicBlockPredecessors :: HasCFG cfgLike => cfgLike -> BasicBlock -> [BasicBlock]Source

basicBlockSuccessors :: HasCFG cfgLike => cfgLike -> BasicBlock -> [BasicBlock]Source