coins.flow
インタフェース SetRefRepr

既知の実装クラスの一覧:
SetRefReprHirEImpl, SetRefReprHirImpl, SetRefReprImpl

public interface SetRefRepr

SetRefRepr interface Used in data flow analysis to represent a Stmt in HIR and an instruction in LIR. This is a wrapper interface that bridges the different data structure and interfaces between HIR and LIR. Used in conjuction with SetRefReprList and its associated SetRefReprIterator, this class serves as a basic building block for basic data flow analysis/optimization.

関連項目:
SetRefReprImpl

フィールドの概要
static int HAS_CONTROL
           
static int IS_RETURN
           
static int SETS
           
 
メソッドの概要
 boolean allFalse()
           
 java.util.List callNodes()
           
 IR defNode()
          Returns the IR node which links to the definitely defined (set) symbol.
 FlowAnalSym defSym()
          Returns the symbol that is definitely defined in this SetRefRepr.
 java.util.Iterator expIterator()
           
 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. // NEEDED
 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. // NEEDED
 BBlock getBBlock()
           
 FlowAnalSym getDefSym()
           
 boolean getFlag(int pFlag)
           
 IR getIR()
          Returns the IR node this SetRefRepr represents.
 java.util.Set getUseFlowAnalSyms()
           
 boolean hasCallWithSideEffect()
           
 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()
           
 java.util.Set lhsSyms()
          Returns the set of symbols that correspond to the set of nodes that are within the LHS of this SetRefRepr.
 java.util.Set modSyms()
          Returns the set of symbols that are possibly modified in this SetRefRepr.
 java.util.Set modSyms00()
          Returns the set of symbols that are accessed by its name in the subprogram containing this SetRefRepr and possibly defined in this SetRefRepr.
 NodeListIterator nodeListIterator()
          DFO iterator over the nodes under the subtree returned by getIR.
 void setFlag(int pFlag, 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.List useNodeList()
          Returns the List of nodes that are associated with a Sym that are used (read), in the depth first order that appears under the subtree returned by getIR().
 java.util.List useSymList()
          Returns the List of FlowAnalSyms used in this SetRefRepr.
 java.util.Set useSyms()
          Returns the Set of the FlowAnalSyms used in this SetRefRepr.
 boolean writesToDefiniteAddress()
           
 

フィールドの詳細

SETS

public static final int SETS
関連項目:
定数フィールド値

HAS_CONTROL

public static final int HAS_CONTROL
関連項目:
定数フィールド値

IS_RETURN

public static final int IS_RETURN
関連項目:
定数フィールド値
メソッドの詳細

getIR

public IR getIR()
Returns the IR node this SetRefRepr represents. getIR() usually refers to the top subtree corresponding to this SetRefREpr, but in case of IfStmt it refers to if-condition expression, and in case of SwitchStmt, it refers to selection-expression. The top subtree corresponding to this SetRefRepr can be get by subpFlow.getLinkedSubtreeOfExpId(getCorrespondingExpId()). //##62

戻り値:
the node this SetRefRepr represents.

useNodeList

public java.util.List useNodeList()
Returns the List of nodes that are associated with a Sym that are used (read), in the depth first order that appears under the subtree returned by getIR(). Nodes that correspond to Syms that are possibly used are included.


useSyms

public java.util.Set useSyms()
Returns the Set of the FlowAnalSyms used in this SetRefRepr. All symbols whose values can be 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.


getUseFlowAnalSyms

public java.util.Set getUseFlowAnalSyms()

useSymList

public java.util.List useSymList()
Returns the List of FlowAnalSyms used in this SetRefRepr. All symbols whose values can be 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.


defNode

public IR defNode()
Returns the IR node which links to the definitely defined (set) symbol. Returns null if sets() returns false.

戻り値:
the IR node which links to the defined (set) symbol.

defSym

public FlowAnalSym defSym()
Returns the symbol that is definitely defined in this SetRefRepr. (Neither consider the possibility of global variable modification by subprogram call nore consider modification by alias relations.) Returns null if sets() returns false, or, for example, in HIR, if this SetRefRepr corresponds to an assignment to an array element.


modSyms

public java.util.Set modSyms()
Returns the set of symbols that are possibly modified in this SetRefRepr. The possibility of global variable modification by subprogram call and modification of address-taken variables by assignment to pointed memory area are not considered (use modSyms00 if they should be considered //##73).


lhsSyms

public java.util.Set lhsSyms()
Returns the set of symbols that correspond to the set of nodes that are within the LHS of this SetRefRepr. Returns null if sets() returns false. The return value is a superset of the return value of getModSyms().


toString

public java.lang.String toString()
Converts to a String object.

オーバーライド:
クラス java.lang.Object 内の toString

nodeListIterator

public NodeListIterator nodeListIterator()
DFO iterator over the nodes under the subtree returned by getIR.


topUseNode

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


useNodeIterator

public java.util.Iterator useNodeIterator()
DFO iterator over the nodes under the subtree returned by getIR(), but the node returned by getDefNode() excluded.


expIterator

public java.util.Iterator expIterator()

expListIterator

public 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. // NEEDED


expListIterator

public 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. // NEEDED

パラメータ:
pFromTop - iterate from top?
pFromLeft - iterate from left?

sets

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


hasCallWithSideEffect

public boolean hasCallWithSideEffect()

callNodes

public java.util.List callNodes()

hasControl

public 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?


isReturn

public boolean isReturn()

allFalse

public boolean allFalse()

getFlag

public boolean getFlag(int pFlag)

setFlag

public void setFlag(int pFlag,
                    boolean pYesNo)

writesToDefiniteAddress

public boolean writesToDefiniteAddress()

modSyms00

public java.util.Set modSyms00()
Returns the set of symbols that are accessed by its name in the subprogram containing this SetRefRepr and possibly defined in this SetRefRepr. Symbols that can be externally defined (i.e. via exteranl calls) are included as well (differs from modSym in this point). //##25-1 This is used in FindPEKill, FindDEGen, //##25-1 and findDefUseExhaustively(), findUseDefExhaustively(). //##73


getDefSym

public FlowAnalSym getDefSym()

getBBlock

public BBlock getBBlock()