Class Type

    • Field Detail

      • relaxedEqSem

        public final boolean relaxedEqSem
    • Method Detail

      • clearCache

        protected final void clearCache()
      • newCVVariant

        public final Type newCVVariant​(int cvAttributes)
        Return a variant of this type matching the given const/volatile attributes. May return this object if the attributes match.
      • isAnon

        public boolean isAnon()
      • getCName

        public final String getCName()
        Returns the name of this type. The returned string is suitable for use as a type specifier for native C. Does not include any const/volatile attributes.
      • getCName

        public String getCName​(boolean includeCVAttrs)
        Returns the name of this type, optionally including const/volatile attributes. The returned string is suitable for use as a type specifier for native C.
      • getName

        public final String getName()
        Returns the name of this type. The returned string is suitable for use as a type specifier for Java. Does not include any const/volatile attributes.
      • getName

        public String getName​(boolean includeCVAttrs)
        Returns the name of this type, optionally including const/volatile attributes. The returned string is suitable for use as a type specifier for Java.
      • toString

        public String toString()
        Returns a string representation of this type. The returned string is suitable for use as a type specifier for native C. It does contain an expanded description of structs/unions, hence may not be suitable for type declarations.
        Overrides:
        toString in class Object
      • getDebugString

        public final String getDebugString()
      • setTypedefName

        public boolean setTypedefName​(String name)
        Set the typedef name of this type and renders this type a typedef, if given name has a length.

        Method issues clearCache(), to force re-evaluation of hashes.

      • isTypedef

        public final boolean isTypedef()
        Indicates whether this type is a typedef type, i.e. declared via setTypedefName(String).
      • getSize

        public final SizeThunk getSize()
        SizeThunk which computes size of this type in bytes.
      • getSize

        public final long getSize​(MachineDataInfo machDesc)
        Size of this type in bytes according to the given MachineDataInfo.
      • asBit

        public BitType asBit()
        Casts this to a BitType or returns null if not a BitType.
      • asInt

        public IntType asInt()
        Casts this to an IntType or returns null if not an IntType.
      • asEnum

        public EnumType asEnum()
        Casts this to an EnumType or returns null if not an EnumType.
      • asFloat

        public FloatType asFloat()
        Casts this to a FloatType or returns null if not a FloatType.
      • asDouble

        public DoubleType asDouble()
        Casts this to a DoubleType or returns null if not a DoubleType.
      • asPointer

        public PointerType asPointer()
        Casts this to a PointerType or returns null if not a PointerType.
      • asArray

        public ArrayType asArray()
        Casts this to an ArrayType or returns null if not an ArrayType.
      • asCompound

        public CompoundType asCompound()
        Casts this to a CompoundType or returns null if not a CompoundType.
      • asFunction

        public FunctionType asFunction()
        Casts this to a FunctionType or returns null if not a FunctionType.
      • asVoid

        public VoidType asVoid()
        Casts this to a VoidType or returns null if not a VoidType.
      • isBit

        public final boolean isBit()
        Indicates whether this is a BitType.
      • isInt

        public final boolean isInt()
        Indicates whether this is an IntType.
      • isEnum

        public final boolean isEnum()
        Indicates whether this is an EnumType.
      • isFloat

        public final boolean isFloat()
        Indicates whether this is a FloatType.
      • isDouble

        public final boolean isDouble()
        Indicates whether this is a DoubleType.
      • isPointer

        public final boolean isPointer()
        Indicates whether this is a PointerType.
      • isArray

        public final boolean isArray()
        Indicates whether this is an ArrayType.
      • isCompound

        public final boolean isCompound()
        Indicates whether this is a CompoundType.
      • isFunction

        public final boolean isFunction()
        Indicates whether this is a FunctionType.
      • isVoid

        public final boolean isVoid()
        Indicates whether this is a VoidType.
      • isVolatile

        public final boolean isVolatile()
        Indicates whether this type is volatile.
      • isConst

        public final boolean isConst()
        Indicates whether this type is const.
      • isPrimitive

        public boolean isPrimitive()
        Indicates whether this type is a primitive type.
      • isFunctionPointer

        public boolean isFunctionPointer()
        Convenience routine indicating whether this Type is a pointer to a function.
      • isBaseTypeConst

        public final boolean isBaseTypeConst()
        Checks the base type of pointer-to-pointer, pointer, array or plain for const-ness.

        Note: Intermediate 'const' qualifier are not considered, e.g. const pointer.

      • hashCode

        public final int hashCode()
        Hashcode for Types.
        Overrides:
        hashCode in class Object
      • hashCodeImpl

        protected abstract int hashCodeImpl()
      • equals

        public final boolean equals​(Object arg)
        Equality test for Types inclusive its given name.
        Overrides:
        equals in class Object
      • equalsImpl

        protected abstract boolean equalsImpl​(Type t)
      • hashCodeSemanticsImpl

        protected abstract int hashCodeSemanticsImpl()
      • equalSemanticsImpl

        protected abstract boolean equalSemanticsImpl​(Type t)
      • visit

        public void visit​(TypeVisitor visitor)
        Traverse this Type and all of its component types; for example, the return type and argument types of a FunctionType.
      • getCVAttributes

        public final int getCVAttributes()
      • getCVAttributesString

        public final String getCVAttributesString()
        Returns a string indicating the const/volatile attributes of this type.
      • pointerDepth

        public int pointerDepth()
        Helper method for determining how many pointer indirections this type represents (i.e., "void **" returns 2). Returns 0 if this type is not a pointer type.
      • arrayDimension

        public int arrayDimension()
        Helper method for determining how many array dimentions this type represents (i.e., "char[][]" returns 2). Returns 0 if this type is not an array type.
      • getBaseElementType

        public Type getBaseElementType()
        Helper method to returns the bottom-most element type of this type.

        If this is a multidimensional array or pointer method returns the bottom-most element type, otherwise this.

      • getTargetType

        public Type getTargetType()
        Helper method to returns the target type of this type, in case another type is being referenced.