coins.aflow
クラス FlowUtil

java.lang.Object
  |
  +--coins.aflow.FlowUtil

public class FlowUtil
extends java.lang.Object

Collection of utility methods. Many of these methods simply wrap the difference in interface/behavior of HIR and LIR.


コンストラクタの概要
FlowUtil()
           
 
メソッドの概要
static java.util.List argsOf(IR pIR)
           
static java.util.List bfSearch(BBlock pEntry, BBlock pExit, boolean pForward)
          Breadth first search.
static int computeHashCodeOfNode(IR pIR)
           
static boolean definitelyOverlaps(FlowExpId pFlowExpId, FlowExpId pFlowExpId0, SubpFlow pSubpFlow)
           
static FlowAnalSym derefedFlowAnalSym(IR pIR)
           
static DNodeIterator dNodeIterator(IR pIR)
          Dynamically scans nodes.
static FlowAnalSym flowAnalSym(IR pIR)
           
static IR getChild1(IR pIR)
          Returns the first child.
static IR getChild2(IR pIR)
          Returns the second child.
static int getChildCount(IR pIR)
          Returns the number of children of the given node.
static HIR getComplexNode(HIR pNode)
           
static HIR getQualVarNode(HIR pNode)
           
static FlowAnalSymVector globalSymVector(SubpFlow pSubpFlow)
          Returns a FlowAnalSymVector that corresponds to the global symbols that appear in that given SubpFlow object.
static boolean hasCallUnder(IR pIR)
          Returns true if the given IR node has as its decendant a call node.
static boolean hasPointerAssign(BBlock pBBlock)
           
static boolean hasPointerAssign(SubpFlow pSubpFlow)
           
static HirIterator hirIterator(HIR pSubtree)
          Iterator that iterates HIR nodes from top to left to right in depth first order.
static boolean isCall(IR pIR)
           
static boolean IsCommonQUAL(HIR pNode)
           
static boolean IsComplexElemNode(HIR pNode)
           
static boolean IsComplexNode(HIR pNode)
           
static boolean IsComplexQUAL(HIR pNode)
           
static boolean isConstNode(IR pIR)
           
static boolean isDefSymNode(IR pIR)
           
static boolean isLvalue(IR pIR)
           
static boolean isSameTree(IR pIR, IR pIR0)
          See if the given two arguments can be identified as same.
static boolean isSameTree(IR pIR, IR pIR0, FlowResults pResults)
          See if the given two arguments can be identified as same, in terms of FlowExpId.
static boolean isSubtreeUnremovable(IR pIR)
           
static boolean isUnder(IR pAncestor, IR pDescendant)
           
static boolean isUnderCall(IR pIR)
           
static boolean IsVarSyms(Sym pSym)
           
static boolean IsVarSymType(Type pType)
           
static boolean isVolatile(IR pIR)
           
static boolean mayBeExternalAddress(IR pIR)
           
static java.util.Set modLvalues(SetRefRepr pSetRefRepr, FlowResults pResults)
           
static NodeIterator nodeIterator(IR pIR)
          Iterator that iterates IR nodes from top to left to right in depth first order.
static NodeListIterator nodeListIterator(IR pIR)
          Iterator that iterates IR nodes from top to left to right in depth first order.
static NodeListIterator nodeListIterator(IR pIR, boolean pFromTop, boolean pFromLeft)
          Iterator that iterates IR nodes.
static boolean notDereferenced(IR pIR)
           
static boolean possiblyOverlaps(FlowExpId pFlowExpId, FlowExpId pFlowExpId0, SubpFlow pSubpFlow)
           
static boolean readsFromIndefiniteAddress(IR pIR)
           
static boolean shouldAssignFlowExpId(IR pIR)
           
static FlowAnalSymVector staticSymVector(SubpFlow pSubpFlow)
           
static java.lang.String toString(HIR pHIR)
          computeHashCodeOfNode: Compute hash code of node pNode taking into account the hash codes of its children so that any two subtrees have the same hash code if they have the same shape.
 
クラス java.lang.Object から継承したメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

コンストラクタの詳細

FlowUtil

public FlowUtil()
メソッドの詳細

getChild1

public static IR getChild1(IR pIR)
Returns the first child.


getChild2

public static IR getChild2(IR pIR)
Returns the second child.


flowAnalSym

public static FlowAnalSym flowAnalSym(IR pIR)

derefedFlowAnalSym

public static FlowAnalSym derefedFlowAnalSym(IR pIR)

getChildCount

public static int getChildCount(IR pIR)
Returns the number of children of the given node.


isConstNode

public static boolean isConstNode(IR pIR)

isSameTree

public static boolean isSameTree(IR pIR,
                                 IR pIR0)
See if the given two arguments can be identified as same. Two subtrees are the same if they have precisely the same structure (subtrees).


isSameTree

public static boolean isSameTree(IR pIR,
                                 IR pIR0,
                                 FlowResults pResults)
See if the given two arguments can be identified as same, in terms of FlowExpId.


hasPointerAssign

public static boolean hasPointerAssign(SubpFlow pSubpFlow)

hasPointerAssign

public static boolean hasPointerAssign(BBlock pBBlock)

globalSymVector

public static FlowAnalSymVector globalSymVector(SubpFlow pSubpFlow)
Returns a FlowAnalSymVector that corresponds to the global symbols that appear in that given SubpFlow object.


staticSymVector

public static FlowAnalSymVector staticSymVector(SubpFlow pSubpFlow)

bfSearch

public static java.util.List bfSearch(BBlock pEntry,
                                      BBlock pExit,
                                      boolean pForward)
Breadth first search. Returns the List of BBlocks in the breadth-first order from pEntry up to pExit. BBlocks unreachable from pEntry or strictly dominated by pExit (when considering the dominator tree rooted at pEntry) will not be included in the returned list. If pExit is not reachable from pEntry, then simply all the BBlocks reachable from pEntry are searched.

パラメータ:
pForward - if true, the search is in the forward direction of the control flow, otherwise, the direction is opposite of that of the control flow.

hirIterator

public static HirIterator hirIterator(HIR pSubtree)
Iterator that iterates HIR nodes from top to left to right in depth first order.


nodeIterator

public static NodeIterator nodeIterator(IR pIR)
Iterator that iterates IR nodes from top to left to right in depth first order.


nodeListIterator

public static NodeListIterator nodeListIterator(IR pIR)
Iterator that iterates IR nodes from top to left to right in depth first order.


nodeListIterator

public static NodeListIterator nodeListIterator(IR pIR,
                                                boolean pFromTop,
                                                boolean pFromLeft)
Iterator that iterates IR nodes. If pFromTop is true, it iterates from top to bottom. If pFromLeft is true, it iterates from left to right. In either case, the order is depth-first (or reverse depth-first, for that matter).


computeHashCodeOfNode

public static int computeHashCodeOfNode(IR pIR)

isUnder

public static boolean isUnder(IR pAncestor,
                              IR pDescendant)

toString

public static java.lang.String toString(HIR pHIR)
computeHashCodeOfNode: Compute hash code of node pNode taking into account the hash codes of its children so that any two subtrees have the same hash code if they have the same shape.


shouldAssignFlowExpId

public static boolean shouldAssignFlowExpId(IR pIR)

dNodeIterator

public static DNodeIterator dNodeIterator(IR pIR)
Dynamically scans nodes.


isDefSymNode

public static boolean isDefSymNode(IR pIR)

isUnderCall

public static boolean isUnderCall(IR pIR)

notDereferenced

public static boolean notDereferenced(IR pIR)

isCall

public static boolean isCall(IR pIR)

argsOf

public static java.util.List argsOf(IR pIR)

readsFromIndefiniteAddress

public static boolean readsFromIndefiniteAddress(IR pIR)

modLvalues

public static java.util.Set modLvalues(SetRefRepr pSetRefRepr,
                                       FlowResults pResults)

isLvalue

public static boolean isLvalue(IR pIR)

possiblyOverlaps

public static boolean possiblyOverlaps(FlowExpId pFlowExpId,
                                       FlowExpId pFlowExpId0,
                                       SubpFlow pSubpFlow)
パラメータ:
pFlowExpId - lvalue

definitelyOverlaps

public static boolean definitelyOverlaps(FlowExpId pFlowExpId,
                                         FlowExpId pFlowExpId0,
                                         SubpFlow pSubpFlow)

hasCallUnder

public static boolean hasCallUnder(IR pIR)
Returns true if the given IR node has as its decendant a call node.


isSubtreeUnremovable

public static boolean isSubtreeUnremovable(IR pIR)

isVolatile

public static boolean isVolatile(IR pIR)

mayBeExternalAddress

public static boolean mayBeExternalAddress(IR pIR)

IsVarSyms

public static boolean IsVarSyms(Sym pSym)

getQualVarNode

public static HIR getQualVarNode(HIR pNode)

IsCommonQUAL

public static boolean IsCommonQUAL(HIR pNode)

IsComplexQUAL

public static boolean IsComplexQUAL(HIR pNode)

getComplexNode

public static HIR getComplexNode(HIR pNode)

IsComplexNode

public static boolean IsComplexNode(HIR pNode)

IsComplexElemNode

public static boolean IsComplexElemNode(HIR pNode)

IsVarSymType

public static boolean IsVarSymType(Type pType)