coins.sym
クラス TypeImpl
java.lang.Object
|
+--coins.sym.SymImpl
|
+--coins.sym.TypeImpl
- すべての実装インタフェース:
- java.lang.Cloneable, HasStringObject, Sym, Sym0, Type
- 直系の既知のサブクラス:
- BaseTypeImpl, DefinedTypeImpl, EntryType, EnumTypeImpl, PointerTypeImpl, RegionTypeImpl, StmtFuncParamType, StructTypeImpl, SubpTypeImpl, UnionTypeImpl, VectorTypeImpl
- public class TypeImpl
- extends SymImpl
- implements Type
TypeImpl Class
フィールドの概要 |
protected Type |
fCompleteType
fCompleteType
Complete type corresponding to this type. |
protected boolean |
fConst
This type is const or not |
protected Type |
fOrigin
Type from which this type derived. |
protected boolean |
fRestrict
This type is restrict or not |
protected java.lang.String |
fTypeCore
fTypeCore is core part of this type, that is,
excluding type qualifier and vector element count.
|
protected int |
fTypeKind
The indication of this Type kind |
protected boolean |
fVolatile
This type is volatile or not |
クラス coins.sym.SymImpl から継承したフィールド |
fDbgLevel, fDefinedIn, fFlagBox, fKind, fName, fNextSym, fRecordedIn, fSourceInf, fSymInf, fType, fUniqueNameSym, fWork, machineParam, sourceLanguage, symRoot |
インタフェース coins.sym.Type から継承したフィールド |
KIND_ADDRESS, KIND_ALIGNMENT, KIND_BASE_LIM, KIND_BOOL, KIND_CHAR, KIND_DEFINED, KIND_DOUBLE, KIND_ENUM, KIND_FLOAT, KIND_FLOAT_LOWER_LIM, KIND_FLOAT_UPPER_LIM, KIND_INT, KIND_INT_UPPER_LIM, KIND_LONG, KIND_LONG_DOUBLE, KIND_LONG_LONG, KIND_OFFSET, KIND_POINTER, KIND_RANKS, KIND_REGION, KIND_SHORT, KIND_STRING, KIND_STRUCT, KIND_SUBP, KIND_U_CHAR, KIND_U_INT, KIND_U_LONG, KIND_U_LONG_LONG, KIND_U_SHORT, KIND_UNDEF, KIND_UNION, KIND_UNSIGNED_LOWER_LIM, KIND_VECTOR, KIND_VOID, KIND_WCHAR |
インタフェース 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_TAG, KIND_TYPE, KIND_VAR, SYM_COMPILE_UNIT, SYM_EXTERN, SYM_PRIVATE, SYM_PROTECTED, SYM_PUBLIC |
メソッドの概要 |
int |
getAlignment()
getAlignment
Get alignment value for this type.
|
int |
getAlignmentGap(long pPrecedingSize)
getAlignmentGap
Get alignment gap size if cumulative size of preceeding elements
is pPreceedingSize. |
Type |
getCompleteType()
getCompleteType
Get complete type corresponding to this type.
|
int |
getDimension()
getDimension
Get the dimension of this type.
|
IrList |
getElemList()
getElemList:
Get the list of struct/union elements.
|
java.lang.String |
getElemListString()
getElemListString
Get element type list of struct, union type in String form.
|
static java.lang.String |
getElemListString(IrList pElemList)
|
static java.lang.String |
getEnumListString(IrList pEnumList)
getEnumListString
Get element list of enum list pEnumList in String form. |
Type |
getFinalOrigin()
getFinalOrigin
Trace the chain of origin types and return the origin as the last one
of the chain. |
Type |
getOrigin()
getOrigin |
Type |
getPointedType()
getPointedType
Get the type of pointed object for PointerType.
|
Exp |
getSizeExp()
getSizeExp
Get size of type.
|
long |
getSizeValue()
getSizeValue
Get the size of this type in bytes.
|
int |
getTypeKind()
getTypeKind
Get the type kind code (Type.KIND_INT, KIND_FLOAT, KIND_POINTER,
KIND_STRUCT, etc. defined in Type interface). |
int |
getTypeRank()
getTypeRank
The type rank shows conversion rank.
|
Type |
getUnqualifiedType()
Trace the chain of origin types and return unqualified type. |
boolean |
isBasicType()
isBasicType |
boolean |
isCompatibleWith(Type pType)
isCompatibleWith
See isCompatibleWith in VectorType, StructType, UnionType,
EnumType, PointerType, SubpType. |
boolean |
isConst()
isConst
See the qualification of "this" type.
|
boolean |
isFloating()
isUnsigned |
boolean |
isInteger()
isInteger |
boolean |
isRestrict()
isRestrict
See the qualification of "this" type.
|
boolean |
isScalar()
|
boolean |
isSizeEvaluable()
isSizeEvaluable |
boolean |
isUnsigned()
isUnsigned |
boolean |
isVolatile()
isVolatile
See the qualification of "this" type.
|
Type |
makeConstType()
makeConstType
Make a new type qualifying this type by "const"
and return it.
|
Type |
makeRestrictType()
makeRestrictType
Make a new type qualifying this type by "restrict"
and return it.
|
Type |
makeVolatileType()
makeVolatileType
Make a new type qualifying this type by "volatile"
and return it.
|
Type |
searchTypeCompatibleWithThis()
|
void |
setOrigin(Type pOrigin)
setOrigin
Set the origin type. |
void |
setSizeExp(Exp pSizeExp)
setSizeExp
Set the size expression of this type.
|
void |
setSizeValue(long pSizeValue)
setSizeValue
Set the size of this type.
|
void |
setStaticTable(MachineParam pMachineParam)
setStaticTable set up static table KIND_ALIGNMENT.
|
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. |
java.lang.String |
toStringShort()
toStringShort
Get name and index of this symbol in text which is not interned. |
クラス 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, unionType, unionType, vectorType, vectorType, vectorType, vectorType, vectorTypeUnfixed, vectorTypeUnfixed |
クラス java.lang.Object から継承したメソッド |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
インタフェース 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, 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 |
fTypeKind
protected int fTypeKind
- The indication of this Type kind
fOrigin
protected Type fOrigin
- Type from which this type derived.
fConst
protected boolean fConst
- This type is const or not
fVolatile
protected boolean fVolatile
- This type is volatile or not
fRestrict
protected boolean fRestrict
- This type is restrict or not
fCompleteType
protected Type fCompleteType
- fCompleteType
Complete type corresponding to this type.
fTypeCore
protected java.lang.String fTypeCore
- fTypeCore is core part of this type, that is,
excluding type qualifier and vector element count.
It should be a name with intern().
TypeImpl
public TypeImpl()
TypeImpl
public TypeImpl(SymRoot pSymRoot)
getTypeKind
public int getTypeKind()
- インタフェース
Type
の記述:
- getTypeKind
Get the type kind code (Type.KIND_INT, KIND_FLOAT, KIND_POINTER,
KIND_STRUCT, etc. defined in Type interface).
- 定義:
- インタフェース
Type
内の getTypeKind
- 戻り値:
- the type kind code of this type.
getOrigin
public Type getOrigin()
- インタフェース
Type
の記述:
- getOrigin
- 定義:
- インタフェース
Type
内の getOrigin
- 戻り値:
- the origin type of this type.
getFinalOrigin
public Type getFinalOrigin()
- インタフェース
Type
の記述:
- getFinalOrigin
Trace the chain of origin types and return the origin as the last one
of the chain.
- 定義:
- インタフェース
Type
内の getFinalOrigin
- 戻り値:
- the final origin type of this type.
getUnqualifiedType
public Type getUnqualifiedType()
- インタフェース
Type
の記述:
- Trace the chain of origin types and return unqualified type.
- 定義:
- インタフェース
Type
内の getUnqualifiedType
- 戻り値:
- unqualified type of this type.
setOrigin
public void setOrigin(Type pOrigin)
- インタフェース
Type
の記述:
- setOrigin
Set the origin type.
- 定義:
- インタフェース
Type
内の setOrigin
- パラメータ:
pOrigin
- origin type of this type.
isBasicType
public boolean isBasicType()
- インタフェース
Type
の記述:
- isBasicType
- 定義:
- インタフェース
Type
内の isBasicType
- 戻り値:
- true if this is a basic type, false otherwize.
isInteger
public boolean isInteger()
- インタフェース
Type
の記述:
- isInteger
- 定義:
- インタフェース
Type
内の isInteger
- 戻り値:
- true if this is an integer type, that is, either
int, short, long, long_long,
u_int, u_short, u_long, u_long_long.
isUnsigned
public boolean isUnsigned()
- インタフェース
Type
の記述:
- isUnsigned
- 定義:
- インタフェース
Type
内の isUnsigned
- 戻り値:
- true if this is an unsigned integer type, that is, either
u_int, u_short, u_long, u_long_long.
isFloating
public boolean isFloating()
- インタフェース
Type
の記述:
- isUnsigned
- 定義:
- インタフェース
Type
内の isFloating
- 戻り値:
- true if this is a floating point type, that is, either
float, double, long_double.
isScalar
public boolean isScalar()
- 定義:
- インタフェース
Type
内の isScalar
getSizeExp
public Exp getSizeExp()
- getSizeExp
Get size of type.
"this" should be a type symbol.
return@ get the size of this type.
- 定義:
- インタフェース
Type
内の getSizeExp
- 戻り値:
- the size expression of this type.
setSizeExp
public void setSizeExp(Exp pSizeExp)
- インタフェース
Type
の記述:
- setSizeExp
Set the size expression of this type.
If pSizeExp can be evaluated as long integer, then
the size value is adjusted to it.
- 定義:
- インタフェース
Type
内の setSizeExp
- パラメータ:
pSizeExp
- Size expression or null if the size is not yet defined.
getSizeValue
public long getSizeValue()
- インタフェース
Type
の記述:
- getSizeValue
Get the size of this type in bytes.
If size value is given as constant, then return 0 or plus value.
If getSizeValue() < 0 and getSizeExp() != null, then
the size is given as non-constant expression (use getSizeExp()).
If getSizeValue() < 0 and getSizeExp() == null, then
no size information is given (incomplete type).
- 定義:
- インタフェース
Type
内の getSizeValue
- 戻り値:
- the size of this type.
setSizeValue
public void setSizeValue(long pSizeValue)
- インタフェース
Type
の記述:
- setSizeValue
Set the size of this type.
if pSizeValue >= 0, then the size expression is adjusted to it.
- 定義:
- インタフェース
Type
内の setSizeValue
- パラメータ:
pSizeValue
- size of this type;
isSizeEvaluable
public boolean isSizeEvaluable()
- インタフェース
Type
の記述:
- isSizeEvaluable
- 定義:
- インタフェース
Type
内の isSizeEvaluable
- 戻り値:
- true if the size is evaluable as long integer
value, false otherwise.
makeConstType
public Type makeConstType()
- インタフェース
Type
の記述:
- makeConstType
Make a new type qualifying this type by "const"
and return it.
If this is already a qualified type, then return this.
If this is StructType/UnionType/EnumType,
finishStructType/finishUnionType/finishEnumType should be
called before calling makeConstType/makeVolatileType/makeRestrictType.
Error if const is given for volatile type.
- 定義:
- インタフェース
Type
内の makeConstType
- 戻り値:
- the qualified type.
makeVolatileType
public Type makeVolatileType()
- インタフェース
Type
の記述:
- makeVolatileType
Make a new type qualifying this type by "volatile"
and return it.
If this is already a qualified type, then return this.
If this is StructType/UnionType/EnumType,
finishStructType/finishUnionType/finishEnumType should be
called before calling makeConstType/makeVolatileType.
Error if volatile is given to const type.
- 定義:
- インタフェース
Type
内の makeVolatileType
- 戻り値:
- the qualified type.
makeRestrictType
public Type makeRestrictType()
- インタフェース
Type
の記述:
- makeRestrictType
Make a new type qualifying this type by "restrict"
and return it.
If this is already a qualified type, then return this.
If this is StructType/UnionType/EnumType,
finishStructType/finishUnionType/finishEnumType should be
called before calling makeConstType/makeVolatileType/makeRestrict.
- 定義:
- インタフェース
Type
内の makeRestrictType
- 戻り値:
- the qualified type.
isConst
public boolean isConst()
- isConst
See the qualification of "this" type.
"this" should be a type symbol.
- 定義:
- インタフェース
Type
内の isConst
- 戻り値:
- boolean true if "this" type is qualified as const,
false otherwise.
isVolatile
public boolean isVolatile()
- isVolatile
See the qualification of "this" type.
"this" should be a type symbol.
- 定義:
- インタフェース
Type
内の isVolatile
- 戻り値:
- true if "this" type is qualified as volatile,
false otherwise.
isRestrict
public boolean isRestrict()
- isRestrict
See the qualification of "this" type.
"this" should be a type symbol.
- 定義:
- インタフェース
Type
内の isRestrict
- 戻り値:
- true if "this" type is qualified as restrict,
false otherwise.
getTypeRank
public int getTypeRank()
- インタフェース
Type
の記述:
- getTypeRank
The type rank shows conversion rank.
The type of operand with lower rank is to be converted to the type
of operand with higher rank in binary arithmetic operation.
- 定義:
- インタフェース
Type
内の getTypeRank
- 戻り値:
- teh conversion rank of this type.
getDimension
public int getDimension()
- getDimension
Get the dimension of this type.
"this" is an array type.
- 定義:
- インタフェース
Type
内の getDimension
- 戻り値:
- the dimension of this type if this is an array type.
1: 1-dimensinal array, 2: 2-dimensional array, ,,, .
If this is not an array type, return 0.
getElemList
public IrList getElemList()
- インタフェース
Type
の記述:
- getElemList:
Get the list of struct/union elements.
The elements of the list is an instance of Elem.
If this type is neither struct nore union,
then null is returned.
- 定義:
- インタフェース
Type
内の getElemList
- 戻り値:
- the list of elements or null.
getPointedType
public Type getPointedType()
- インタフェース
Type
の記述:
- getPointedType
Get the type of pointed object for PointerType.
If this type is not PointerType, then null is returned.
- 定義:
- インタフェース
Type
内の getPointedType
- 戻り値:
- the type of pointed object if this is a pointer,
otherwise return null.
getElemListString
public java.lang.String getElemListString()
- インタフェース
Type
の記述:
- getElemListString
Get element type list of struct, union type in String form.
The elements of the list represents the type name of
struct/union type.
If this type has no element, then "{}" is returned.
- 定義:
- インタフェース
Type
内の getElemListString
- 戻り値:
- the list of element type names of struct/union.
getElemListString
public static java.lang.String getElemListString(IrList pElemList)
getEnumListString
public static java.lang.String getEnumListString(IrList pEnumList)
- getEnumListString
Get element list of enum list pEnumList in String form.
getAlignment
public int getAlignment()
- インタフェース
Type
の記述:
- getAlignment
Get alignment value for this type.
It depends on target machine.
For basic types, the alignment value is a byte count
specified in MachineParam.java.
The default value of alignment of VectorType is
the alignment of element type which may differ
vector by vector.
The defalut alignment value of StructType or UnionType is set
to that of its element with the largest alignment value
which may differ struct by struct or union by union.
The alignment value of StructType, UnionType, or VectorType
should be set by setAlignment method of corresponding type
when the type is defined.
As for subprogram, if alignment of return value is required,
get it by subp.getReturnValueType().getAlignment(), and
if alignment of subprogram object code is required,
get it by symRoot.machineParam.getAlignment(Type.KIND_SUBP). //##67
- 定義:
- インタフェース
Type
内の getAlignment
- 戻り値:
- the alignment number of this type in bytes.
getAlignmentGap
public int getAlignmentGap(long pPrecedingSize)
- インタフェース
Type
の記述:
- getAlignmentGap
Get alignment gap size if cumulative size of preceeding elements
is pPreceedingSize.
- 定義:
- インタフェース
Type
内の getAlignmentGap
isCompatibleWith
public boolean isCompatibleWith(Type pType)
- isCompatibleWith
See isCompatibleWith in VectorType, StructType, UnionType,
EnumType, PointerType, SubpType.
- 定義:
- インタフェース
Type
内の isCompatibleWith
- パラメータ:
pType
- a type to be compared with this type.
- 戻り値:
- true if this type is compatible with pType.
getCompleteType
public Type getCompleteType()
- getCompleteType
Get complete type corresponding to this type.
If this is a complete type, return this type.
See getCompleteType in VectorType, StructType, UnionType,
EnumType.
- 定義:
- インタフェース
Type
内の getCompleteType
searchTypeCompatibleWithThis
public Type searchTypeCompatibleWithThis()
setStaticTable
public void setStaticTable(MachineParam pMachineParam)
- setStaticTable set up static table KIND_ALIGNMENT.
This method is not recommended to be called except from SymRoot.
toString
public java.lang.String toString()
- インタフェース
HasStringObject
の記述:
- Get the string image of object.
- 定義:
- インタフェース
HasStringObject
内の toString
- オーバーライド:
- クラス
SymImpl
内の toString
toStringShort
public java.lang.String toStringShort()
- インタフェース
Sym
の記述:
- toStringShort
Get name and index of this symbol in text which is not interned.
- 定義:
- インタフェース
Sym
内の toStringShort
- オーバーライド:
- クラス
SymImpl
内の toStringShort
toStringDetail
public java.lang.String toStringDetail()
- インタフェース
Sym
の記述:
- toStringDetail
Get detailed attributes of this symbol in text which is not
interned.
- 定義:
- インタフェース
Sym
内の toStringDetail
- オーバーライド:
- クラス
SymImpl
内の toStringDetail