coins.sym
Class ExpIdImpl

java.lang.Object
  extended bycoins.sym.SymImpl
      extended bycoins.sym.ExpIdImpl
All Implemented Interfaces:
java.lang.Cloneable, ExpId, FlowAnalSym, HasStringObject, Sym, Sym0

public class ExpIdImpl
extends SymImpl
implements ExpId

ExpIdImpl


Field Summary
protected  HIR fCopiedExp
           
protected  IrList fDefList
          Definition list containing IR nodes that define the value of this symbol.
protected  ExpInf fExpInf
           
protected  FlowExpId fFlowExpId
          FlowExpId corresponding to this ExpId.
protected  ExpId fHashChain
           
protected  int fIdNumber
           
protected  int fIndex
           
protected  IR fLinkedNode
           
protected  java.util.Set fOperandSet
           
protected  IrList fUseList
          Use list containing IR nodes that use (refer) this symbol.
 
Fields inherited from class coins.sym.SymImpl
fDbgLevel, fDefinedIn, fFlagBox, fKind, fName, fNextSym, fRecordedIn, fSourceInf, fSymInf, fType, fUniqueNameSym, fWork, machineParam, sourceLanguage, symRoot
 
Fields inherited from interface coins.sym.Sym
KIND_NAME, VISIBILITY
 
Fields inherited from interface coins.sym.Sym0
FLAG_ADDRESS_TAKEN, FLAG_CASTLESS_SUBP, FLAG_COMMON, FLAG_COMPLEX_STRUCT, FLAG_DERIVED_SYM, FLAG_GENERATED_SYM, FLAG_INCOMPLETE_TYPE, FLAG_POINTER_OPERATION, FLAG_REGION_ELEM, FLAG_RESERVED_NAME, FLAG_SIZEOF_TAKEN, FLAG_UNFIXED_SIZE, FLAG_UNIFORM_SIZE, FLAG_VALUE_IS_ASSIGNED, KIND_AREG, KIND_BOOL_CONST, KIND_CHAR_CONST, KIND_CONST_FIRST, KIND_CONST_LAST, KIND_ELEM, KIND_EXP_ID, KIND_FLOAT_CONST, KIND_INT_CONST, KIND_LABEL, KIND_MREG, KIND_NAMED_CONST, KIND_OTHER, KIND_PARAM, KIND_REMOVED, KIND_STRING_CONST, KIND_SUBP, KIND_TAG, KIND_TYPE, KIND_VAR, SYM_COMPILE_UNIT, SYM_EXTERN, SYM_PRIVATE, SYM_PROTECTED, SYM_PUBLIC
 
Constructor Summary
ExpIdImpl(SymRoot pSymRoot, java.lang.String pExpIdName, Sym pDefinedIn)
           
 
Method Summary
 void addOperand(FlowAnalSym pOperand)
           
 HIR getCopiedExp()
          getCopiedExp Get the expression for which this ExpId is first created.
 ExpInf getExpInf()
           
 FlowExpId getFlowExpId()
          getFlowExpId Get the FlowExpId that is used in aflow.
 int getIndex()
          getIndex Get the index number assigned to the symbol.
 IR getLinkedNode()
          getLinkedNode Get the IR node for which this ExpId is first created.
 Sym getLinkedSym()
          getLinkedSym If the linked node of this ExpId has symbol connected to it, then return it, else return null.
 ExpId getNextId()
          getNextId Get the next ExpId in the hash chain.
 int getNumberOfOperations()
          Returns the number of operations this FlowExpId involves.
 java.util.Set getOperandSet()
          Returns the set of FlowAnalSyms that are operands of this FlowExpId.
 java.util.Set getOperandSet0()
          Returns the set of FlowAnalSyms that are operands of this FlowExpId, and that hold the value that may contribute to the result of the computation of this FlowExpId.
 SetRefRepr getSetRefRepr()
           Get SetRefRepr information that is used in data flow analysis for the expression corresponding to this ExpId.
 boolean isLHS()
           
 void resetFlowAnalInf()
          resetFlowAnalInf Reset information for flow analysis, that is, nullify DefUseList, definition list, use list, ExpId, and reset the index value to 0.
 void setExpInf(ExpInf pExpInf)
           
 void setFlowExpId(FlowExpId pFlowExpId)
          setFlowExpId Set the FlowExpId that is used in aflow.
 void setIndex(int pIndex)
          setIndex Set the index number assigned to the symbol.
 void setNextId(ExpId pNextId)
          setNextId Set the next ExpId in the hash chain.
 void setSetRefRepr(SetRefRepr pSetRefRepr)
           Set SetRefRepr information that is used in data flow analysis for the expression corresponding to this ExpId.
 java.lang.String toString()
          Get the string image of object.
 java.lang.String toStringDetail()
          toStringDetail Get detailed attributes of this symbol in text which is not interned.
 
Methods inherited from class coins.sym.SymImpl
bareStringConst, baseType, boolConst, charConst, charConst, charConst, definedType, definedType, defineElem, defineLabel, defineParam, defineRegionVar, defineSubp, defineVar, defineVar, derivedSym, enumType, enumType, floatConst, floatConst, getDefinedColumn, getDefinedFile, getDefinedIn, getDefinedInName, getDefinedLine, getFlag, getInf, getName, getNameOrNull, getNextSym, getOrAddInf, getOriginalSym, getOriginalSym, getPureName, getRecordedIn, getSourceInf, getSymKind, getSymKindName, getSymType, getUniqueName, getWork, intConst, intConst, intObject, isGlobal, isHIR, isRemoved, isSym, linkSym, makeCstring, makeCstringWithTrailing0, makeEnumTypeName, makeExpString, makeJavaString, makeStructUnionTypeName, makeSubpTypeName, makeSubpTypeName, makeVectorTypeName, makeVectorTypeName, makeVectorTypeName, namedConst, namedConst, pointerType, pointerType, pointerType, pointerType, pointerType, print, print, regionType, regionType, remove, setDefinedFile, setDefinedIn, setDefinedLine, setFlag, setOriginalSym, setParameters, setRecordedIn, setSourceInf, setSymKind, setSymType, setUniqueNameSym, setWork, stringConst, stringConstFromQuotedString, structType, structType, subpType, subpType, symbol, toStringShort, unionType, unionType, vectorType, vectorType, vectorType, vectorType, vectorTypeUnfixed, vectorTypeUnfixed
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface coins.sym.Sym
baseType, boolConst, charConst, defineVar, derivedSym, floatConst, getDefinedColumn, getDefinedInName, getDefinedLine, getInf, getNameOrNull, getOrAddInf, getOriginalSym, getOriginalSym, getPureName, getSymKindName, getWork, intConst, intObject, isRemoved, makeCstring, makeCstringWithTrailing0, makeEnumTypeName, makeJavaString, makeStructUnionTypeName, makeSubpTypeName, makeVectorTypeName, makeVectorTypeName, makeVectorTypeName, namedConst, pointerType, pointerType, pointerType, regionType, remove, setDefinedFile, setDefinedIn, setDefinedLine, setRecordedIn, setSymKind, setSymType, setUniqueNameSym, setWork, stringConstFromQuotedString, symbol, toStringShort, vectorType, vectorType, vectorType, vectorTypeUnfixed
 
Methods inherited from interface coins.sym.Sym0
charConst, definedType, defineElem, defineLabel, defineParam, defineSubp, defineVar, enumType, floatConst, getDefinedFile, getDefinedIn, getFlag, getName, getNextSym, getRecordedIn, getSymKind, getSymType, getUniqueName, intConst, isGlobal, namedConst, pointerType, setFlag, stringConst, structType, subpType, unionType, vectorType, vectorTypeUnfixed
 

Field Detail

fHashChain

protected ExpId fHashChain

fIdNumber

protected int fIdNumber

fLinkedNode

protected IR fLinkedNode

fCopiedExp

protected HIR fCopiedExp

fExpInf

protected ExpInf fExpInf

fFlowExpId

protected FlowExpId fFlowExpId
FlowExpId corresponding to this ExpId.


fDefList

protected IrList fDefList
Definition list containing IR nodes that define the value of this symbol.


fUseList

protected IrList fUseList
Use list containing IR nodes that use (refer) this symbol.


fIndex

protected int fIndex

fOperandSet

protected java.util.Set fOperandSet
Constructor Detail

ExpIdImpl

public ExpIdImpl(SymRoot pSymRoot,
                 java.lang.String pExpIdName,
                 Sym pDefinedIn)
Method Detail

getLinkedNode

public IR getLinkedNode()
Description copied from interface: ExpId
getLinkedNode Get the IR node for which this ExpId is first created. It may be affected by some optimization after the ExpId assignment. There may be other IR nodes with the same subtree structure as the it.

Specified by:
getLinkedNode in interface ExpId
Returns:
the IR node corresponding to this ExpId.

getCopiedExp

public HIR getCopiedExp()
Description copied from interface: ExpId
getCopiedExp Get the expression for which this ExpId is first created. It is not affected by optimization after the ExpId assignment.

Specified by:
getCopiedExp in interface ExpId
Returns:
the IR node corresponding to this ExpId.

getLinkedSym

public Sym getLinkedSym()
Description copied from interface: ExpId
getLinkedSym If the linked node of this ExpId has symbol connected to it, then return it, else return null.

Specified by:
getLinkedSym in interface ExpId
Returns:
the corresponding symbol or return null.

getNextId

public ExpId getNextId()
Description copied from interface: ExpId
getNextId Get the next ExpId in the hash chain.

Specified by:
getNextId in interface ExpId
Returns:
the next ExpId in the hash chain.

setNextId

public void setNextId(ExpId pNextId)
Description copied from interface: ExpId
setNextId Set the next ExpId in the hash chain.

Specified by:
setNextId in interface ExpId
Parameters:
pNextId - the next ExpId in the hash chain.

toString

public java.lang.String toString()
Description copied from interface: HasStringObject
Get the string image of object.

Specified by:
toString in interface HasStringObject
Overrides:
toString in class SymImpl

toStringDetail

public java.lang.String toStringDetail()
Description copied from interface: Sym
toStringDetail Get detailed attributes of this symbol in text which is not interned.

Specified by:
toStringDetail in interface Sym
Overrides:
toStringDetail in class SymImpl

setExpInf

public void setExpInf(ExpInf pExpInf)
Specified by:
setExpInf in interface ExpId

getExpInf

public ExpInf getExpInf()
Specified by:
getExpInf in interface ExpId

isLHS

public boolean isLHS()
Specified by:
isLHS in interface ExpId

getOperandSet

public java.util.Set getOperandSet()
Description copied from interface: ExpId
Returns the set of FlowAnalSyms that are operands of this FlowExpId. An operand of a FlowExpId is simply a FlowAnalSym that is attached to one of the nodes that comprise the tree represented by the FlowExpId.

Specified by:
getOperandSet in interface ExpId

getOperandSet0

public java.util.Set getOperandSet0()
Description copied from interface: ExpId
Returns the set of FlowAnalSyms that are operands of this FlowExpId, and that hold the value that may contribute to the result of the computation of this FlowExpId. For example, in HIR, if a symbol node is operated by the addressOf operator, and there is no contentsOf operator operating at all afterwards, the symbol attached to the symbol node is not included in the set returned by this method.

Specified by:
getOperandSet0 in interface ExpId

getNumberOfOperations

public int getNumberOfOperations()
Description copied from interface: ExpId
Returns the number of operations this FlowExpId involves. This is not more than but roughly equal to the number of this FlowExpId's linked node's descendant nodes.

Specified by:
getNumberOfOperations in interface ExpId

setSetRefRepr

public void setSetRefRepr(SetRefRepr pSetRefRepr)
Description copied from interface: ExpId
 Set SetRefRepr information that is used in
 data flow analysis for the expression corresponding
 to this ExpId.
 The SetRefRepr represents such information as
   set of symbols refered by the expression/statement
   set of symbols modified by the expression/statement
   ...

Specified by:
setSetRefRepr in interface ExpId
Parameters:
pSetRefRepr - information to be set.

getSetRefRepr

public SetRefRepr getSetRefRepr()
Description copied from interface: ExpId
 Get SetRefRepr information that is used in
 data flow analysis for the expression corresponding
 to this ExpId.
 The SetRefRepr represents such information as
   set of symbols refered by the expression/statement
   set of symbols modified by the expression/statement
   ...
 

Specified by:
getSetRefRepr in interface ExpId
Returns:
the corresponding SetRefRepr instance.

getIndex

public int getIndex()
Description copied from interface: FlowAnalSym
getIndex Get the index number assigned to the symbol. The index number is used in data flow analysis, etc. For ExpId, do not use setIndex but use setLinkedNode. If no index number is assigned to this symbol, return 0.

Specified by:
getIndex in interface FlowAnalSym
Returns:
the index number assigned to the symbol.

setIndex

public void setIndex(int pIndex)
Description copied from interface: FlowAnalSym
setIndex Set the index number assigned to the symbol. The index number is used in data flow analysis, etc. For ExpId, do not use setIndex but use setLinkedNode.

Specified by:
setIndex in interface FlowAnalSym
Parameters:
pIndex - index number to be set to this symbol.

resetFlowAnalInf

public void resetFlowAnalInf()
Description copied from interface: FlowAnalSym
resetFlowAnalInf Reset information for flow analysis, that is, nullify DefUseList, definition list, use list, ExpId, and reset the index value to 0.

Specified by:
resetFlowAnalInf in interface FlowAnalSym

addOperand

public void addOperand(FlowAnalSym pOperand)

getFlowExpId

public FlowExpId getFlowExpId()
Description copied from interface: ExpId
getFlowExpId Get the FlowExpId that is used in aflow.

Specified by:
getFlowExpId in interface ExpId
Returns:
FlowExpId.

setFlowExpId

public void setFlowExpId(FlowExpId pFlowExpId)
Description copied from interface: ExpId
setFlowExpId Set the FlowExpId that is used in aflow.

Specified by:
setFlowExpId in interface ExpId
Parameters:
pFlowExpId - corresponding FlowExpId instance.