coins.flow
Class LoopInfImpl

java.lang.Object
  extended bycoins.flow.LoopInfImpl
All Implemented Interfaces:
LoopInf

public class LoopInfImpl
extends java.lang.Object
implements LoopInf

LoopInfImpl Loop information class. LoopInf IS NOT USED ANY MORE. lparallel used LoopInfo of lparallel. //##78


Field Summary
protected  java.util.LinkedList fAlternateEntryBBlockList
           
protected  java.util.LinkedList fAlternateEntryNodeList
           
protected  java.util.LinkedList fBBlockList
           
protected  BBlock fEntryBBlock
           
protected  IR fEntryNode
           
protected  LoopInf fFirstChild
           
protected  FlagBox fFlagBox
           
protected  FlowRoot flowRoot
           
protected  LoopInf fNextBrother
           
protected  LoopInf fParent
           
 
Fields inherited from interface coins.flow.LoopInf
HAS_CALL, HAS_PTR_ASSIGN, HAS_STRUCT_UNION, IRREDUCIBLE, USE_PTR
 
Constructor Summary
LoopInfImpl(FlowRoot pFlowRoot, IR pEntryNode)
           
 
Method Summary
 void addAlternateEntryBBlock(BBlock pEntryBBlock)
          addAlternateEntryBBlock Add pEntryBBlock as an alternate entry BBlock of this LoopInf.
 void addAlternateEntryNode(IR pEntryNode)
          addAlternateEntryNode Add pEntryNode as an alternate entry node of this LoopInf.
 void addBBlock(BBlock pBBlock)
          addBBlock Add pBBlock to the BBlock list of this LoopInf.
 void deleteBBlock(BBlock pBBlock)
          deleteBBlock Delete pBBlock from the BBlock list of this LoopInf.
 java.util.List getAlternateEntryBBlockList()
          getAlternateEntryBBlockList Get the list of alternate entry BBlock.
 java.util.List getAlternateEntryNodeList()
          getAlternateEntryNodeList Get the list of alternate entry node.
 java.util.List getBBlockList()
           
 BBlock getEntryBBlock()
          getEntryBBlock Get entry BBlock of the loop corresponding to this LoopInf.
 LoopInf getFirstChild()
          getFirstChild setFirstChild Get/set the first child LoopInf of this LoopInf, where, the first child LoopInf is the LoopInf corresponding to the first loop directly contained in the loop correnponding to this LoopInf.
 boolean getFlag(int pFlagNumber)
          getFlag setFlag getFlag returns the value (true/false) of the flag indicated by pFlagNumber.
 LoopInf getNextBrother()
          getNextBrother setNextBrother Get/set the next brother LoopInf of this LoopInf, where, the next brother LoopInf is the LoopInf having the same parent LoopInf as this LoopInf.
 LoopInf getParent()
          getParent setParent Get/set parent LoopInf of this LoopInf, where, parent LoopInf is the LoopInf corresponding to the loop directly containing the loop correnponding to this LoopInf.
 void print(int pDebugLevel)
          print Print this LoopInf and its children and brother LoopInf for debugging purpose if dbgFlow >= pDebigLevel.
 void propagateFlag(int pFlagNumber)
          propagateFlag Set flag of pFlagNumber to be true and if this has parent, then set the same flag of the parent and its ancestors.
 void setEntryBBlock(BBlock pEntryBBlock)
          setEntryBBlock Set entry BBlock of the loop corresponding to this LoopInf.
 void setFirstChild(LoopInf pChild)
           
 void setFlag(int pFlagNumber, boolean pYesNo)
           
 void setNextBrother(LoopInf pBrother)
           
 void setParent(LoopInf pParent)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

flowRoot

protected final FlowRoot flowRoot

fParent

protected LoopInf fParent

fFirstChild

protected LoopInf fFirstChild

fNextBrother

protected LoopInf fNextBrother

fBBlockList

protected java.util.LinkedList fBBlockList

fEntryNode

protected IR fEntryNode

fAlternateEntryNodeList

protected java.util.LinkedList fAlternateEntryNodeList

fEntryBBlock

protected BBlock fEntryBBlock

fAlternateEntryBBlockList

protected java.util.LinkedList fAlternateEntryBBlockList

fFlagBox

protected FlagBox fFlagBox
Constructor Detail

LoopInfImpl

public LoopInfImpl(FlowRoot pFlowRoot,
                   IR pEntryNode)
Method Detail

getParent

public LoopInf getParent()
Description copied from interface: LoopInf
getParent setParent Get/set parent LoopInf of this LoopInf, where, parent LoopInf is the LoopInf corresponding to the loop directly containing the loop correnponding to this LoopInf. If there is no parent, then getParent rerurns null.

Specified by:
getParent in interface LoopInf

setParent

public void setParent(LoopInf pParent)
Specified by:
setParent in interface LoopInf

getFirstChild

public LoopInf getFirstChild()
Description copied from interface: LoopInf
getFirstChild setFirstChild Get/set the first child LoopInf of this LoopInf, where, the first child LoopInf is the LoopInf corresponding to the first loop directly contained in the loop correnponding to this LoopInf. If there is no child, then getFirstChild rerurns null.

Specified by:
getFirstChild in interface LoopInf

setFirstChild

public void setFirstChild(LoopInf pChild)
Specified by:
setFirstChild in interface LoopInf

getNextBrother

public LoopInf getNextBrother()
Description copied from interface: LoopInf
getNextBrother setNextBrother Get/set the next brother LoopInf of this LoopInf, where, the next brother LoopInf is the LoopInf having the same parent LoopInf as this LoopInf. If there is no next brother, then getNextBrother rerurns null.

Specified by:
getNextBrother in interface LoopInf

setNextBrother

public void setNextBrother(LoopInf pBrother)
Specified by:
setNextBrother in interface LoopInf

getEntryBBlock

public BBlock getEntryBBlock()
Description copied from interface: LoopInf
getEntryBBlock Get entry BBlock of the loop corresponding to this LoopInf. If there are several entry (irreducible loop), get the BBlock that is set by setEntryBBlock.

Specified by:
getEntryBBlock in interface LoopInf
Returns:
thte entry BBlock.

setEntryBBlock

public void setEntryBBlock(BBlock pEntryBBlock)
Description copied from interface: LoopInf
setEntryBBlock Set entry BBlock of the loop corresponding to this LoopInf. If there are several entry (irreducible loop), select one of them as principal entry BBlock and set it as the entry BBlock.

Specified by:
setEntryBBlock in interface LoopInf
Parameters:
pEntryBBlock - principal entry BBlock. The entry BBlock is added to the BBlock list of this LoopInf and its parent.

getBBlockList

public java.util.List getBBlockList()
Specified by:
getBBlockList in interface LoopInf

addBBlock

public void addBBlock(BBlock pBBlock)
Description copied from interface: LoopInf
addBBlock Add pBBlock to the BBlock list of this LoopInf. If pBBlock has not yet linked to LoopInf, then it is linked to this LoopInf (inner-most LoopInf containing pBBlock). If this LoopInf has parent, then pBBlock is added to the parent LoopInf, too.

Specified by:
addBBlock in interface LoopInf
Parameters:
pBBlock - BBlock to be added.

deleteBBlock

public void deleteBBlock(BBlock pBBlock)
Description copied from interface: LoopInf
deleteBBlock Delete pBBlock from the BBlock list of this LoopInf. The linkage to LoopInf of pBBlock is nullified. If this LoopInf has parent, then pBBlock is deleted from the parent LoopInf, too.

Specified by:
deleteBBlock in interface LoopInf
Parameters:
pBBlock - BBlock to be deleted.

getAlternateEntryNodeList

public java.util.List getAlternateEntryNodeList()
Description copied from interface: LoopInf
getAlternateEntryNodeList Get the list of alternate entry node. If there is no alternate entry node (reducible loop) then return null.

Specified by:
getAlternateEntryNodeList in interface LoopInf
Returns:
the list of alternate entry node.

getAlternateEntryBBlockList

public java.util.List getAlternateEntryBBlockList()
Description copied from interface: LoopInf
getAlternateEntryBBlockList Get the list of alternate entry BBlock. If there is no alternate entry BBlock (reducible loop) then return null.

Specified by:
getAlternateEntryBBlockList in interface LoopInf
Returns:
the list of alternate entry BBlock.

addAlternateEntryNode

public void addAlternateEntryNode(IR pEntryNode)
Description copied from interface: LoopInf
addAlternateEntryNode Add pEntryNode as an alternate entry node of this LoopInf. Duplication is avoided.

Specified by:
addAlternateEntryNode in interface LoopInf
Parameters:
pEntryNode - an alternate entry node.

addAlternateEntryBBlock

public void addAlternateEntryBBlock(BBlock pEntryBBlock)
Description copied from interface: LoopInf
addAlternateEntryBBlock Add pEntryBBlock as an alternate entry BBlock of this LoopInf. Duplication is avoided.

Specified by:
addAlternateEntryBBlock in interface LoopInf
Parameters:
pEntryBBlock - an alternate entry BBlock.

getFlag

public boolean getFlag(int pFlagNumber)
Description copied from interface: LoopInf
getFlag setFlag getFlag returns the value (true/false) of the flag indicated by pFlagNumber. setFlag sets the flag of specified number.

Specified by:
getFlag in interface LoopInf
Parameters:
pFlagNumber - flag identification number (see below).

setFlag

public void setFlag(int pFlagNumber,
                    boolean pYesNo)
Specified by:
setFlag in interface LoopInf

propagateFlag

public void propagateFlag(int pFlagNumber)
Description copied from interface: LoopInf
propagateFlag Set flag of pFlagNumber to be true and if this has parent, then set the same flag of the parent and its ancestors.

Specified by:
propagateFlag in interface LoopInf

print

public void print(int pDebugLevel)
Description copied from interface: LoopInf
print Print this LoopInf and its children and brother LoopInf for debugging purpose if dbgFlow >= pDebigLevel.

Specified by:
print in interface LoopInf