coins.aflow
Class SetRefReprImpl

java.lang.Object
  extended bycoins.aflow.SetRefReprImpl
All Implemented Interfaces:
SetRefRepr
Direct Known Subclasses:
SetRefReprEImpl, SetRefReprHirImpl

public abstract class SetRefReprImpl
extends java.lang.Object
implements SetRefRepr

Implementation of the SetRefRepr interface


Field Summary
protected  BBlock fBBlock
           
protected  FlowAnalSym fDefSym
          Symbol or ExpId defined by this SetRefRepr.
protected  FlagBox fFlags
           
protected  IR fIR
           
 FlowRoot flowRoot
           
protected  int fOpCode
           
(package private)  FlowResults fResults
           
protected  java.util.List fUseExpIdList
           
protected  java.util.List fUseNodeList
           
 SymRoot symRoot
           
 
Fields inherited from interface coins.aflow.SetRefRepr
HAS_CONTROL, IS_RETURN, SETS
 
Constructor Summary
protected SetRefReprImpl(IR pIR, BBlock pBBlock)
          SetRefReprImpl //##25-1 Make an instance of SetRefRepr for the subtree pIR in the basic block pBBlock.
 
Method Summary
 boolean allFalse()
           
 FlowExpId defFlowExpId()
          Returns the FlowExpId that correponds to the node returned by getDefNode().
 java.util.Iterator expIterator()
          Returns the Set of nodes that have FlowAnalSym attached and are not a Def node.
 java.util.ListIterator expListIterator()
          Returns a DFO iterator that iterates over nodes that have a FlowExpId attached, and, if "this" is value-setting, is not a Def node.
 java.util.ListIterator expListIterator(boolean pFromTop, boolean pFromLeft)
          Returns an DFO iterator that iterates over nodes that have a FlowExpId attached, and, if "this" is value-setting, is not a Def node.
 java.util.ListIterator expListIteratorFromBottom()
           
abstract  java.util.List exps()
           
(package private) abstract  java.util.List exps(boolean pFromTop, boolean pFromLeft)
           
 BBlock getBBlock()
           
 ExpVector getDAvailIn()
           
 FlowAnalSymVector getDDefIn()
           
 FlowAnalSymVector getDDefined()
           
 FlowAnalSym getDefSym()
           
 FlowAnalSymVector getDExposed()
           
 DefVector getDKill()
           
 DefVector getDReach()
           
 FlowAnalSymVector getDUsed()
           
 boolean getFlag(int pFlagNumber)
           
 java.util.Set getFlowExpIds()
           
 IR getIR()
          Returns the (top) node this SetRefRepr represents.
 FlowAnalSymVector getPDefined()
           
 ExpVector getPEKill()
           
 FlowAnalSymVector getPExposed()
           
 DefVector getPKill()
           
 FlowAnalSymVector getPLiveOut()
           
 DefVector getPReach()
           
 FlowAnalSymVector getPUsed()
           
 java.util.Set getUseFlowExpIds()
           
 boolean hasControl()
          Does this SetRefRepr is at the end of the BBlock and has a role to determine the flow of control after this SetRefRepr?
 boolean isReturn()
           
 NodeIterator nodeIterator()
          DFO iterator over the nodes under the subtree returned by getIR.
 NodeListIterator nodeListIterator()
           
 NodeListIterator nodeListIterator(boolean pFromTop, boolean pFromLeft)
          DFO iterator over the nodes under the subtree returned by getIR().
 void setFlag(int pFlagNumber, boolean pYesNo)
           
 boolean sets()
          Returns true if this SetRefRepr involves value-setting, other than via the external call.
 IR topUseNode()
          If this is a value-setting node, returns the top node of the RHS.
 java.lang.String toString()
          Converts to a String object.
 java.util.Iterator useNodeIterator()
          DFO iterator over the nodes under the subtree returned by getIR(), but the node returned by getDefNode() excluded.
 java.util.Set useSyms()
          Returns the Set of the FlowAnalSyms used in this SetRefRepr.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface coins.aflow.SetRefRepr
callNodes, defNode, defSym, hasCallWithSideEffect, lhsSyms, modSyms, modSyms00, useNodeList, writesToDefiniteAddress
 

Field Detail

flowRoot

public final FlowRoot flowRoot

symRoot

public final SymRoot symRoot

fIR

protected IR fIR

fUseNodeList

protected java.util.List fUseNodeList

fUseExpIdList

protected java.util.List fUseExpIdList

fOpCode

protected int fOpCode

fResults

FlowResults fResults

fFlags

protected FlagBox fFlags

fBBlock

protected BBlock fBBlock

fDefSym

protected FlowAnalSym fDefSym
Symbol or ExpId defined by this SetRefRepr.

Constructor Detail

SetRefReprImpl

protected SetRefReprImpl(IR pIR,
                         BBlock pBBlock)
SetRefReprImpl //##25-1 Make an instance of SetRefRepr for the subtree pIR in the basic block pBBlock.

Method Detail

getIR

public IR getIR()
Description copied from interface: SetRefRepr
Returns the (top) node this SetRefRepr represents.

Specified by:
getIR in interface SetRefRepr
Returns:
the node this SetRefRepr represents.

useSyms

public java.util.Set useSyms()
Description copied from interface: SetRefRepr
Returns the Set of the FlowAnalSyms used in this SetRefRepr. All symbols whose values can possibly referred within this SetRefRepr are included, but those that can be referred to through the external calls (i.e. global symbols) within this SetRefRepr are not considered.

Specified by:
useSyms in interface SetRefRepr

topUseNode

public IR topUseNode()
Description copied from interface: SetRefRepr
If this is a value-setting node, returns the top node of the RHS. If not, returns the same node as getIR().

Specified by:
topUseNode in interface SetRefRepr

getFlowExpIds

public java.util.Set getFlowExpIds()

getUseFlowExpIds

public java.util.Set getUseFlowExpIds()

defFlowExpId

public FlowExpId defFlowExpId()
Description copied from interface: SetRefRepr
Returns the FlowExpId that correponds to the node returned by getDefNode().

Specified by:
defFlowExpId in interface SetRefRepr

getDefSym

public FlowAnalSym getDefSym()
Specified by:
getDefSym in interface SetRefRepr

toString

public java.lang.String toString()
Description copied from interface: SetRefRepr
Converts to a String object.

Specified by:
toString in interface SetRefRepr

nodeIterator

public NodeIterator nodeIterator()
Description copied from interface: SetRefRepr
DFO iterator over the nodes under the subtree returned by getIR.

Specified by:
nodeIterator in interface SetRefRepr

nodeListIterator

public NodeListIterator nodeListIterator()
Specified by:
nodeListIterator in interface SetRefRepr

nodeListIterator

public NodeListIterator nodeListIterator(boolean pFromTop,
                                         boolean pFromLeft)
Description copied from interface: SetRefRepr
DFO iterator over the nodes under the subtree returned by getIR().

Specified by:
nodeListIterator in interface SetRefRepr
Parameters:
pFromTop - If true, iterates from the top of the subtree.
pFromLeft - if true, iterates from the left of the subtree.

useNodeIterator

public java.util.Iterator useNodeIterator()
Description copied from interface: SetRefRepr
DFO iterator over the nodes under the subtree returned by getIR(), but the node returned by getDefNode() excluded.

Specified by:
useNodeIterator in interface SetRefRepr

expIterator

public java.util.Iterator expIterator()
Returns the Set of nodes that have FlowAnalSym attached and are not a Def node. Returns the Set of nodes that have FlowAnalSym attached and are not a Def node.

Specified by:
expIterator in interface SetRefRepr
See Also:
SetRefRepr.defNode()

expListIterator

public java.util.ListIterator expListIterator()
Description copied from interface: SetRefRepr
Returns a DFO iterator that iterates over nodes that have a FlowExpId attached, and, if "this" is value-setting, is not a Def node. // NEEDED

Specified by:
expListIterator in interface SetRefRepr

expListIteratorFromBottom

public java.util.ListIterator expListIteratorFromBottom()

exps

public abstract java.util.List exps()

exps

abstract java.util.List exps(boolean pFromTop,
                             boolean pFromLeft)

expListIterator

public java.util.ListIterator expListIterator(boolean pFromTop,
                                              boolean pFromLeft)
Description copied from interface: SetRefRepr
Returns an DFO iterator that iterates over nodes that have a FlowExpId attached, and, if "this" is value-setting, is not a Def node. // NEEDED

Specified by:
expListIterator in interface SetRefRepr
Parameters:
pFromTop - iterate from top?
pFromLeft - iterate from left?

getFlag

public boolean getFlag(int pFlagNumber)
Specified by:
getFlag in interface SetRefRepr

setFlag

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

allFalse

public boolean allFalse()
Specified by:
allFalse in interface SetRefRepr

sets

public boolean sets()
Description copied from interface: SetRefRepr
Returns true if this SetRefRepr involves value-setting, other than via the external call.

Specified by:
sets in interface SetRefRepr

hasControl

public boolean hasControl()
Description copied from interface: SetRefRepr
Does this SetRefRepr is at the end of the BBlock and has a role to determine the flow of control after this SetRefRepr?

Specified by:
hasControl in interface SetRefRepr

isReturn

public boolean isReturn()
Specified by:
isReturn in interface SetRefRepr

getDKill

public DefVector getDKill()
Specified by:
getDKill in interface SetRefRepr

getPReach

public DefVector getPReach()
Specified by:
getPReach in interface SetRefRepr

getBBlock

public BBlock getBBlock()
Specified by:
getBBlock in interface SetRefRepr

getDReach

public DefVector getDReach()
Specified by:
getDReach in interface SetRefRepr

getPKill

public DefVector getPKill()
Specified by:
getPKill in interface SetRefRepr

getDAvailIn

public ExpVector getDAvailIn()
Specified by:
getDAvailIn in interface SetRefRepr

getPEKill

public ExpVector getPEKill()
Specified by:
getPEKill in interface SetRefRepr

getDDefIn

public FlowAnalSymVector getDDefIn()
Specified by:
getDDefIn in interface SetRefRepr

getDDefined

public FlowAnalSymVector getDDefined()
Specified by:
getDDefined in interface SetRefRepr

getPDefined

public FlowAnalSymVector getPDefined()
Specified by:
getPDefined in interface SetRefRepr

getDExposed

public FlowAnalSymVector getDExposed()
Specified by:
getDExposed in interface SetRefRepr

getDUsed

public FlowAnalSymVector getDUsed()
Specified by:
getDUsed in interface SetRefRepr

getPExposed

public FlowAnalSymVector getPExposed()
Specified by:
getPExposed in interface SetRefRepr

getPLiveOut

public FlowAnalSymVector getPLiveOut()
Specified by:
getPLiveOut in interface SetRefRepr

getPUsed

public FlowAnalSymVector getPUsed()
Specified by:
getPUsed in interface SetRefRepr