ibis.satin.impl.syncrewriter.controlflow
Class BasicBlockGraph

java.lang.Object
  extended by ibis.satin.impl.syncrewriter.controlflow.BasicBlockGraph

public class BasicBlockGraph
extends Object

A basic block graph is a graph of basic blocks of a method.


Constructor Summary
BasicBlockGraph(MethodGen methodGen)
          Instantiates a basic block graph from a method.
 
Method Summary
 BasicBlock getBasicBlock(int id)
          Returns the basic block with identifier id in the graph.
 ArrayList<Path> getEndingPathsFrom(int id)
          Returns the ending paths from the basic block with identifier id.
 int getIdBasicBlock(org.apache.bcel.generic.InstructionHandle ih)
          Returns the id of the basic block that contains an instruction.
 boolean isPartOfLoop(int id)
          Tests whether basic block with id id is part of a loop.
 String toString()
          Returns a string representation of the basic block graph.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BasicBlockGraph

public BasicBlockGraph(MethodGen methodGen)
Instantiates a basic block graph from a method.

Parameters:
methodGen - method
Method Detail

getBasicBlock

public BasicBlock getBasicBlock(int id)
Returns the basic block with identifier id in the graph.

Parameters:
id - the identifier of the basic block in the graph.
Returns:
the basic block with identifier id.

isPartOfLoop

public boolean isPartOfLoop(int id)
Tests whether basic block with id id is part of a loop.

Parameters:
id - The id of the basic block.
Returns:
true if basic block with identifier id is part of a loop; false otherwise.

getEndingPathsFrom

public ArrayList<Path> getEndingPathsFrom(int id)
Returns the ending paths from the basic block with identifier id.

Parameters:
id - the identifier of the basic block from which all ending paths have to be calculated.
Returns:
a list of paths that exit the method.

getIdBasicBlock

public int getIdBasicBlock(org.apache.bcel.generic.InstructionHandle ih)
Returns the id of the basic block that contains an instruction.

Parameters:
ih - the instruction that is part of a basic block.
Returns:
the id of the basic block that contains instruction ih.

toString

public String toString()
Returns a string representation of the basic block graph.

Overrides:
toString in class Object


The Ibis project