coins.ssa
Class Util

java.lang.Object
  extended bycoins.ssa.Util

class Util
extends java.lang.Object

Utilities for the SSA module


Constructor Summary
(package private) Util(SsaEnvironment e, Function function)
          Constructor
 
Method Summary
(package private)  void changeLabelRef(boolean isTranslate)
          Change the LabelRef node into the SSA specified ones.
(package private)  BiList findTargetLir(LirNode root, int opCode, BiList l)
          Search and find the LIR nodes which has the specified operation code.
(package private)  LirNode makeNewJump(BasicBlk blk, LirLabelRef labelRef)
          Make a new JUMP node to the specified label.
(package private)  LirNode makePhiInst(Symbol s, BasicBlk blk)
          Make a new Phi instruction.
(package private)  BiList predEdges(BasicBlk blk, boolean getPredBlk)
          Collect the edges from the predecessors or predecessors themselves.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Util

Util(SsaEnvironment e,
     Function function)
Constructor

Parameters:
e - The environment of the SSA module
function - The current function
Method Detail

makeNewJump

LirNode makeNewJump(BasicBlk blk,
                    LirLabelRef labelRef)
Make a new JUMP node to the specified label.

Parameters:
blk - The basic block which the new JUMP node put in
labelRef - The label which the new JUMP node go to
Returns:
A new JUMP node

findTargetLir

BiList findTargetLir(LirNode root,
                     int opCode,
                     BiList l)
Search and find the LIR nodes which has the specified operation code.

Parameters:
root - The root node of the search
opCode - The specified operation code
l - The list which is stored in the found LIR node
Returns:
The list of LIR nodes

changeLabelRef

void changeLabelRef(boolean isTranslate)
Change the LabelRef node into the SSA specified ones. Or Change the LabelRef node into the normal ones. This method MUST be called before translating into SSA form.

Parameters:
isTranslate - True if the translation is for the specified ones

predEdges

BiList predEdges(BasicBlk blk,
                 boolean getPredBlk)
Collect the edges from the predecessors or predecessors themselves.

Parameters:
blk - The current basic blk
getPredBlk - True means to collect predecessors
Returns:
The list of edges or basic blocks

makePhiInst

LirNode makePhiInst(Symbol s,
                    BasicBlk blk)
Make a new Phi instruction. The arguments and the variable that defined by this new Phi instruction have the specified symbol.

Parameters:
s - The specified symbol
blk - The basic block which the new phi instruction is inserted
Returns:
A new Phi instruction