coins.backend.cfg
Class FlowGraph

java.lang.Object
  extended bycoins.backend.cfg.FlowGraph

public class FlowGraph
extends java.lang.Object

Represent Control Flow Graph, a directed graph whose nodes are basic blocks.


Field Summary
 BiList basicBlkList
          List of basic blocks.
 Function function
          Function owning this CFG.
 
Constructor Summary
FlowGraph(Function f, BiList anInstrList)
          Split LIR instruction list into basic blocks and build up CFG.
 
Method Summary
 java.util.Iterator basicBlkIterator()
          Return iterator for accessing basic blocks.
 BasicBlk[] blkVectorByPre()
          Deprecated. use DFST class instead.
 BasicBlk[] blkVectorByRPost()
          Deprecated. use DFST class instead.
 void dfstOrder()
          Deprecated. use DFST class instead.
 void dfstOrderHook(DfstHook h)
          Deprecated. use DFST class instead.
 BasicBlk entryBlk()
          Return the entry basic block.
 BasicBlk exitBlk()
          Return the exit basic block.
 int idBound()
          Return maximum block numer + 1.
 BasicBlk insertNewBlkBefore(BasicBlk x)
          Insert new empty basic block before block x.
 int maxDfn()
          Deprecated. use DFST class instead.
(package private)  BasicBlk newBasicBlk(BiList instr)
          Create new basic block with instruction list instr.
 void printIt(java.io.PrintWriter output)
          Print CFG
 void printIt(java.io.PrintWriter output, LocalAnalysis[] anals)
          Print CFG with callback
 void printStandardForm(java.io.PrintWriter output, java.lang.String indent)
          Print standard form
 int timeStamp()
          Return last modified time of the graph.
 java.lang.Object toSexp()
          Convert to external LIR format.
 void touch()
          Notify that the graph has been modified.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

function

public final Function function
Function owning this CFG.


basicBlkList

public final BiList basicBlkList
List of basic blocks.

Constructor Detail

FlowGraph

public FlowGraph(Function f,
                 BiList anInstrList)
Split LIR instruction list into basic blocks and build up CFG.

Method Detail

timeStamp

public int timeStamp()
Return last modified time of the graph. Time is just a counter rather than actual time-of-the-day.


touch

public void touch()
Notify that the graph has been modified.


newBasicBlk

BasicBlk newBasicBlk(BiList instr)
Create new basic block with instruction list instr.


insertNewBlkBefore

public BasicBlk insertNewBlkBefore(BasicBlk x)
Insert new empty basic block before block x.


idBound

public int idBound()
Return maximum block numer + 1.


dfstOrder

public void dfstOrder()
Deprecated. use DFST class instead.

Make Depth First Spanning Tree. Fields dfn(Depth First Number in rever postorder), dfnPre(preorder), parent are set.


dfstOrderHook

public void dfstOrderHook(DfstHook h)
Deprecated. use DFST class instead.

Depth First Ordering


maxDfn

public int maxDfn()
Deprecated. use DFST class instead.

Return maximum number of DFN (depth first number).


blkVectorByRPost

public BasicBlk[] blkVectorByRPost()
Deprecated. use DFST class instead.

Return the vector of basic block indexed by DFN reverse postorder. Zeroth element is null, entry block is in [1].


blkVectorByPre

public BasicBlk[] blkVectorByPre()
Deprecated. use DFST class instead.

Return the vector of basic block indexed by DFN preorder. Zeroth element is null, entry block is in [1].


entryBlk

public BasicBlk entryBlk()
Return the entry basic block.


exitBlk

public BasicBlk exitBlk()
Return the exit basic block.


basicBlkIterator

public java.util.Iterator basicBlkIterator()
Return iterator for accessing basic blocks.


toSexp

public java.lang.Object toSexp()
Convert to external LIR format.


printStandardForm

public void printStandardForm(java.io.PrintWriter output,
                              java.lang.String indent)
Print standard form


printIt

public void printIt(java.io.PrintWriter output)
Print CFG


printIt

public void printIt(java.io.PrintWriter output,
                    LocalAnalysis[] anals)
Print CFG with callback