public class FlowGraph extends Object
| Constructor and Description |
|---|
FlowGraph()
Constructs a new uninitialized flow graph.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addBlock(BasicBlock b)
Adds a block to this flow graph.
|
void |
addCallback(Function f,
CallbackKind kind)
Adds the given callback to the flow graph.
|
void |
addFunction(Function f)
Adds the given function to the flow graph.
|
void |
check()
Perform a consistency check of the flow graph (if in debug or test mode).
|
FlowGraph |
complete()
Runs complete on all the functions in the flow graph.
|
Set<Function> |
getCallbacksByKind(CallbackKind kind)
Retrieves the callbacks of the given kind.
|
BasicBlock |
getEntryBlock()
Returns the entry block of the flow graph.
|
Function |
getFunction(String name)
Returns the function with the given name.
|
Collection<Function> |
getFunctions()
Returns the functions, including the main function.
|
Function |
getMain()
Returns the main code.
|
int |
getNumberOfBlocks()
Returns the total number of basic blocks in this flow graph.
|
int |
getNumberOfNodes()
Returns the total number of nodes in this flow graph.
|
void |
removeFunctions(Collection<Function> fs)
Deletes a collection of functions from the flow graph.
|
void |
toDot(PrintWriter pw)
Produces a Graphviz dot representation of this flow graph.
|
void |
toDot(String dest_dir,
boolean end)
Produces a Graphviz dot representation of each function in this flow graph.
|
String |
toString()
Returns a string description of this flow graph.
|
public void addBlock(BasicBlock b)
b - The basic block to add.public void addCallback(Function f, CallbackKind kind)
public void addFunction(Function f)
public void check()
public FlowGraph complete()
public Set<Function> getCallbacksByKind(CallbackKind kind)
public BasicBlock getEntryBlock()
public Collection<Function> getFunctions()
public Function getMain()
public int getNumberOfBlocks()
public int getNumberOfNodes()
public void removeFunctions(Collection<Function> fs)
public void toDot(PrintWriter pw)
public void toDot(String dest_dir, boolean end) throws IOException
dest_dir - destination directoryend - if set, the name contains "final", otherwise "initial"IOException - if some file operation fails.Copyright © 2012 Aarhus University