Class CompoundType

    • Method Detail

      • rename

        public void rename​(String newName)
        Description copied from interface: AliasedSymbol
        Rename this symbol with the given newName if not equal current-name.

        Before renaming the current-name will be added to the list of aliases. while the given newName will be removed.

        Operation will be ignored if newName is null.

        Specified by:
        rename in interface AliasedSymbol
        Parameters:
        newName - the new current-name, maybe null
      • addAliasedName

        public void addAliasedName​(String origName)
        Description copied from interface: AliasedSymbol
        Add the given origName to the list of aliases if not equal current-name.

        Operation will be ignored if newName is null.

        Specified by:
        addAliasedName in interface AliasedSymbol
        Parameters:
        origName - the new alias to be added, maybe null
      • create

        public static CompoundType create​(String structName,
                                          SizeThunk size,
                                          CompoundTypeKind kind,
                                          int cvAttributes,
                                          ASTLocusTag astLocus)
        Parameters:
        structName - struct name of this CompoundType, i.e. the "foo" in the construct struct foo { int a, ... }; or struct foo; even for anonymous structs.
        size -
        kind -
        cvAttributes -
        Returns:
      • hashCodeImpl

        protected int hashCodeImpl()
        Specified by:
        hashCodeImpl in class Type
      • equalsImpl

        protected boolean equalsImpl​(Type arg)
        Specified by:
        equalsImpl in class Type
      • getStructName

        public String getStructName()
        Returns the struct name of this CompoundType, i.e. the "foo" in the construct "struct foo { ... };".
      • asCompound

        public CompoundType asCompound()
        Description copied from class: Type
        Casts this to a CompoundType or returns null if not a CompoundType.
        Overrides:
        asCompound in class Type
      • getCName

        public String getCName​(boolean includeCVAttrs)
        Description copied from class: Type
        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.
        Overrides:
        getCName in class Type
      • getNumFields

        public int getNumFields()
        Returns the number of fields in this type.
      • getField

        public Field getField​(int i)
        Returns the ith field of this type.
      • getField

        public Field getField​(String name)
        Returns the name matching field of this type.
      • addField

        public void addField​(Field f)
        Adds a field to this type.
      • isStruct

        public abstract boolean isStruct()
        Indicates whether this type was declared as a struct.
      • isUnion

        public abstract boolean isUnion()
        Indicates whether this type was declared as a union.
      • toString

        public String toString()
        Description copied from class: Type
        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 Type
      • visit

        public void visit​(TypeVisitor arg)
        Description copied from class: Type
        Traverse this Type and all of its component types; for example, the return type and argument types of a FunctionType.
        Overrides:
        visit in class Type
      • getStructString

        public String getStructString()