coins.mdf
Class MacroTask

java.lang.Object
  extended bycoins.mdf.MacroTask

public class MacroTask
extends java.lang.Object

This class represents a macro task. Each macro tasks include some basic blocks as a list. And also, each macro tasks have their entry and exit basic blocks.


Field Summary
 Label label
          The label of the current macro task
 java.util.LinkedList predList
          The list of macro tasks which are the predecessor of the current macro task
 java.util.LinkedList succList
          The list of macro tasks which are the successor of the current macro task
static int THR
          The threshold for debugging output
 
Constructor Summary
MacroTask(MdfEnvironment e, int num, BBlock blk, Label lab)
          Constructor:
MacroTask(MdfEnvironment e, int num, Label lab)
          Constructor:
 
Method Summary
(package private)  BBlock addBasicBlk(BBlock blk)
          Add the specified basic block into the current macro task.
 BBlock[] blks()
          Get the basic blocks which the current macro task includes.
(package private)  MacroTask concat(MacroTask mt)
          Concatenate macro tasks.
 BBlock entryBlk()
          Get the entry basic block of the current macro task.
 java.util.LinkedList exitBlks()
          Get the list of basic blocks in the current macro task, the basic blocks means the exit block from the current macro task.
(package private)  boolean hasCall()
          check whether the current macro task has some function calls.
(package private)  boolean hasReturn()
          Check whether the current macro task has some return statements.
(package private)  void printGraph(java.io.OutputStreamWriter output)
          Print the node as graphviz format.
 int taskNumber()
          Get the unique number of the current macro task.
 java.lang.String toString()
          Get the string image of the current macro task.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

THR

public static final int THR
The threshold for debugging output

See Also:
Constant Field Values

predList

public final java.util.LinkedList predList
The list of macro tasks which are the predecessor of the current macro task


succList

public final java.util.LinkedList succList
The list of macro tasks which are the successor of the current macro task


label

public final Label label
The label of the current macro task

Constructor Detail

MacroTask

public MacroTask(MdfEnvironment e,
                 int num,
                 BBlock blk,
                 Label lab)
Constructor:

Parameters:
e - The environment of the MDF module
num - The unique number of the current macro task
blk - The entry basic block of the current macro task
lab - The label of the current macro task

MacroTask

public MacroTask(MdfEnvironment e,
                 int num,
                 Label lab)
Constructor:

Parameters:
e - The environment of the MDF module
num - The unique number of the current macro task
lab - The label of the current macro task
Method Detail

taskNumber

public int taskNumber()
Get the unique number of the current macro task.

Returns:
The unique number of the current macro task

entryBlk

public BBlock entryBlk()
                throws PassException
Get the entry basic block of the current macro task.

Returns:
The entry basic block of the current macro task.
Throws:
PassException - Any exceptions in it

exitBlks

public java.util.LinkedList exitBlks()
Get the list of basic blocks in the current macro task, the basic blocks means the exit block from the current macro task.

Returns:
The list of the basic block which means the exit blocks

hasReturn

boolean hasReturn()
Check whether the current macro task has some return statements. If so, return true.

Returns:
True if the current macro task has some return statements. Otherwise return false

hasCall

boolean hasCall()
check whether the current macro task has some function calls. If so, return true.

Returns:
True if the current macro task has some function calls. Otherwise return false

blks

public BBlock[] blks()
              throws PassException
Get the basic blocks which the current macro task includes. The basic blocks are sorted by reverse post order.

Returns:
The basic blocks which the current macro task includes
Throws:
PassException - Any exceptions in it

addBasicBlk

BBlock addBasicBlk(BBlock blk)
Add the specified basic block into the current macro task.

Parameters:
blk - The basic block which should be added
Returns:
The basic block which has been added into the current macro task

concat

MacroTask concat(MacroTask mt)
           throws PassException
Concatenate macro tasks.

Parameters:
mt - The macro task which should be concatenated with the current macro task
Returns:
The macro task which has been concatenated.
Throws:
PassException - Any exceptions in it

toString

public java.lang.String toString()
Get the string image of the current macro task.

Returns:
The string image of the current macro task

printGraph

void printGraph(java.io.OutputStreamWriter output)
Print the node as graphviz format.

Parameters:
output - The output stream