coins.sym
クラス ElemImpl

java.lang.Object
  |
  +--coins.sym.SymImpl
        |
        +--coins.sym.VarImpl
              |
              +--coins.sym.ElemImpl
すべての実装インタフェース:
java.lang.Cloneable, Elem, FlowAnalSym, HasStringObject, Sym, Sym0, Var

public class ElemImpl
extends VarImpl
implements Elem

class Elem


フィールドの概要
 
クラス coins.sym.VarImpl から継承したフィールド
fDefList, fDefUseList, fIndex, fOperandSet, fUseList
 
クラス coins.sym.SymImpl から継承したフィールド
fDbgLevel, fDefinedIn, fFlagBox, fKind, fName, fNextSym, fRecordedIn, fSourceInf, fSymInf, fType, fUniqueNameSym, fWork, machineParam, sourceLanguage, symRoot
 
インタフェース coins.sym.Var から継承したフィールド
STORAGECLASS, VAR_AUTO, VAR_REGISTER, VAR_STATIC
 
インタフェース coins.sym.Sym から継承したフィールド
KIND_NAME, VISIBILITY
 
インタフェース 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
 
コンストラクタの概要
ElemImpl(SymRoot pSymRoot)
           
ElemImpl(SymRoot pSymRoot, java.lang.String pElemName, Sym pDefinedIn)
           
ElemImpl(SymRoot pSymRoot, java.lang.String pElemName, Sym pDefinedIn, Exp pDispExp)
           
 
メソッドの概要
 long evaluateDisp()
          evaluateDisp "this" should be an element of struct/union type symbol.
 int getBitOffset()
          getBitOffset See also setBitFieldOffset method.
 int getBitSize()
          getBitSize See also setBitFieldOffset method.
 Type getUpperType()
          getUpperType
 boolean isBitField()
          isBitField
 boolean isDispEvaluable()
          isDispEvaluable Get the displacement of elements.
 Elem searchElem(Type pRecordedIn)
          searchElem Get the proper element having the same name as this symbol in pRecordedIn construct (structure or union).
 Elem searchElem(Var pVar)
          searchElem Get the proper element having the same name as this symbol in the struct/union variable pVar.
 void setBitField(int pBitSize, int pBitOffset)
           
 void setBitFieldOffset(int pBitOffset)
          setBitFieldOffset Set bit field offset of this element if it is a bit field.
 void setBitFieldSize(int pBitSize)
           Set the size of bit field and set an indication showing that this element is a bit field.
 void setDispExp(Exp pDispExp)
          setDispExp Set the displacement of this element.
 void setDisplacement(long pDisplacement)
           
 java.lang.String toString()
          Get the string image of object.
 
クラス coins.sym.VarImpl から継承したメソッド
addOperand, evaluateAsObject, getDimension, getIndex, getInitialValue, getNext, getOperandSet, getSize, getStorageClass, getVisibility, isSizeEvaluable, resetFlowAnalInf, setIndex, setInitialValue, setNext, setStorageClass, setVisibility, toStringDetail
 
クラス 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
 
クラス java.lang.Object から継承したメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
インタフェース coins.sym.Var から継承したメソッド
evaluateAsObject, getDimension, getInitialValue, getNext, getSize, getStorageClass, getVisibility, isSizeEvaluable, setInitialValue, setNext, setStorageClass, setVisibility
 
インタフェース 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, toStringDetail, toStringShort, vectorType, vectorType, vectorType, vectorTypeUnfixed
 
インタフェース 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
 

コンストラクタの詳細

ElemImpl

public ElemImpl(SymRoot pSymRoot)

ElemImpl

public ElemImpl(SymRoot pSymRoot,
                java.lang.String pElemName,
                Sym pDefinedIn)

ElemImpl

public ElemImpl(SymRoot pSymRoot,
                java.lang.String pElemName,
                Sym pDefinedIn,
                Exp pDispExp)
メソッドの詳細

isDispEvaluable

public boolean isDispEvaluable()
isDispEvaluable Get the displacement of elements. "this" should be an element of struct/union type symbol.

定義:
インタフェース Elem 内の isDispEvaluable
戻り値:
true if the displacement of this element is evaluable as integer value, false otherwise.

evaluateDisp

public long evaluateDisp()
evaluateDisp "this" should be an element of struct/union type symbol.

定義:
インタフェース Elem 内の evaluateDisp
戻り値:
integer value representing the displacement

setDispExp

public void setDispExp(Exp pDispExp)
インタフェース Elem の記述:
setDispExp Set the displacement of this element.

定義:
インタフェース Elem 内の setDispExp
パラメータ:
pDispExp - Expression representing the displacement of this element in byte.

setDisplacement

public void setDisplacement(long pDisplacement)
定義:
インタフェース Elem 内の setDisplacement

setBitFieldSize

public void setBitFieldSize(int pBitSize)
インタフェース Elem の記述:
 Set the size of bit field and set an indication showing
 that this element is a bit field.
 The size of bit field should not exceed the bit width
 of long (typeLong.getSizeValue()*8).
 See also setBitFieldOffset method.

定義:
インタフェース Elem 内の setBitFieldSize
パラメータ:
pBitSize - number of bits in this bit field.

setBitFieldOffset

public void setBitFieldOffset(int pBitOffset)
インタフェース Elem の記述:
setBitFieldOffset
  Set bit field offset of this element if it is a bit field.
  Consider bit offset and bit field length of a bit field are
  represented by bitOffset and bitFieldSize each respectively.
  In the case of machineParam.isPackedFromLeft() is true,
  the most significant bit of the 1st field is placed at
  the most significant bit of "containing object" (which is
  explained later), and the bit field is placed at bit positions
     bitOffset through (bitOffset + bitFieldSize - 1)
  in the containing object, where the most significant bit position
  of the containing object is zero and the least significant bit
  position is (bit width of containing object -1).
  In the case of machineParam.isPackedFromLeft() is false, that is,
  machineParam.isPackedFromRight() is true,
  the least significant bit of the 1st field is placed at
  the least significant bit of containing object, and
  the bit field is placed at bit positions
     bitOffset through (bitOffset + bitFieldSize - 1)
  in the containing object, where the least significant bit position
  of the containing object is zero and the most significant bit
  position is (bit width of containing object -1).
  In both cases, displacement of the containing object within the
  surrounding structure is shown by evaluateDisp().
  Source language analyzer is not requested to set bit field offset
  but requested to set only the size of bit fields by
  setBitFieldSize method because the bit offset computation is
  usually done by finishStructType() of StructType.
  "containing object" mentioned in the previous paragraph is a
  hypothetical object that contains bit fields. The alignment/size
  of the containing object is considered to be the alignment/size
  of the largest bit field type among the consecutive
  bit fields (all of which have type int or unsigned int in C).
  When a bit field is encountered in structure declaration and
  the total size of preceding elements is lSize, then
  the displacement of the containing object is computed as
      (lSize / lElemTypeSize) * lElemTypeSize
  where lElemTypeSize is the size of the largest bit field type
  among the consecutive bit fields.
  If the containing object has space to hold the bit field,
  then the bit field is placed in the containing object.
  When there remains no space to hold new bit field after
  successive allocation of preceding bit fields, a new
  containing object is placed adjacent to the old one
  and remaining bit fields are placed in the new containing
  object.
  A bit field is contained in one containing object and does not
  span to multiple containing objects. Multiple bit fields may be
  contained in one containing object if the containing object can
  contain them and bit fields continues successively.
  The structure is supposed to have the alignment greater or equal
  to the alignment of the containing object and its size is the
  multiple of the size of the containing object.
  Consider a C language structure
     struct st1 {
       short s1;
       char  c1;
       unsigned int b1:5;
       unsigned int b2:1;
       unsigned int b3:3;
       char c2;
     };
  on machine having 2 as short size, 4 as int size. Displacements
  and bit offsets in this case will be as follows:
     element displacement  bit offset
       s1      0            -
       c1      2            -
       b1      0           24
       b2      0           29
       b3      4            0
       c2      5            -
  and the structure will have alignment 4 and size 8.
  As for C program
    struct bitField1 {
    unsigned a1:1;
    unsigned b1:1;
  };
  struct bitField2 {
    struct bitField1 st1;
    unsigned char cc1;
    struct bitField1 st2;
   unsigned char cc2;
  };
 Displacements and bit offsets in this case will be as follows:
     element displacement  bit offset
     st1.a1    0            0
     st1.b1    0            1
     cc1       4            -
     st2.a1    8            0
     st2.b1    8            1
     cc2      12            -
  and the structure will have alignment 4 and size 16.

  A bit field can be loaded to register by loading the corresponding
  containing object whose displacement can be get be evaluateDisp().
  Access methods of a bit field shows
    evaluateDisp(): displacement of the containing object containing
                    the bit field.
    getBitSize():   the number of bits in the bit field.
    getBitOffset(): bit offset position in the containing object
                    (its meaning differs according to the value of
                     isPackedFromLeft() as mentioned before).

定義:
インタフェース Elem 内の setBitFieldOffset
パラメータ:
pBitOffset - bit offset of the bit field as explained above.

setBitField

public void setBitField(int pBitSize,
                        int pBitOffset)

getBitSize

public int getBitSize()
インタフェース Elem の記述:
getBitSize See also setBitFieldOffset method.

定義:
インタフェース Elem 内の getBitSize
戻り値:
the number of bits in this field.

getBitOffset

public int getBitOffset()
インタフェース Elem の記述:
getBitOffset See also setBitFieldOffset method.

定義:
インタフェース Elem 内の getBitOffset
戻り値:
the bit offset of this field.

isBitField

public boolean isBitField()
インタフェース Elem の記述:
isBitField

定義:
インタフェース Elem 内の isBitField
戻り値:
true if this is a bit field, false otherwise.

searchElem

public Elem searchElem(Var pVar)
インタフェース Elem の記述:
searchElem Get the proper element having the same name as this symbol in the struct/union variable pVar. "this" is a symbol having the same name as the element to be searched.

定義:
インタフェース Elem 内の searchElem
パラメータ:
pVar - sturcture or union variable.
戻り値:
the proper element defined in pDefinedIn. This is used in such case as to distinguish proper element when same element name is used in different structures.

searchElem

public Elem searchElem(Type pRecordedIn)
インタフェース Elem の記述:
searchElem Get the proper element having the same name as this symbol in pRecordedIn construct (structure or union). "this" is a symbol having the same name as the element to be searched.

定義:
インタフェース Elem 内の searchElem
パラメータ:
pRecordedIn - enclosing construct defining the element to be searched (sturcture type or union type in C).
戻り値:
the proper element defined in pRecordedIn. If not found, return null. This is used in such case as to distinguish proper element when same element name is used in different structures.

getUpperType

public Type getUpperType()
インタフェース Elem の記述:
getUpperType

定義:
インタフェース Elem 内の getUpperType
戻り値:
StructType or UnionType instance containing this element.

toString

public java.lang.String toString()
インタフェース HasStringObject の記述:
Get the string image of object.

定義:
インタフェース HasStringObject 内の toString
オーバーライド:
クラス SymImpl 内の toString