Go: cmd/compile/internal/types Index | Files

package types

import "cmd/compile/internal/types"


Package Files

etype_string.go identity.go pkg.go scope.go sym.go type.go utils.go


const (
    CMPlt = Cmp(-1)
    CMPeq = Cmp(0)
    CMPgt = Cmp(1)
const (
    IgnoreBlankFields componentsIncludeBlankFields = false
    CountBlankFields  componentsIncludeBlankFields = true
const BADWIDTH = -1000000000
const MaxPkgHeight = 1e9

MaxPkgHeight is a height greater than any likely package height.


var (
    // Predeclared alias types. Kept separate for better error messages.
    Bytetype *Type
    Runetype *Type

    // Predeclared error interface type.
    Errortype *Type

    // Types to represent untyped string and boolean constants.
    Idealstring *Type
    Idealbool   *Type

    // Types to represent untyped numeric constants.
    Idealint     = New(TIDEAL)
    Idealrune    = New(TIDEAL)
    Idealfloat   = New(TIDEAL)
    Idealcomplex = New(TIDEAL)
var (
    // TSSA types. HasPointers assumes these are pointer-free.
    TypeInvalid = newSSA("invalid")
    TypeMem     = newSSA("mem")
    TypeFlags   = newSSA("flags")
    TypeVoid    = newSSA("void")
    TypeInt128  = newSSA("int128")
var (
    Widthptr    int
    Dowidth     func(*Type)
    Fatalf      func(string, ...interface{})
    Sconv       func(*Sym, int, int) string       // orig: func sconv(s *Sym, flag FmtFlag, mode fmtMode) string
    Tconv       func(*Type, int, int) string      // orig: func tconv(t *Type, flag FmtFlag, mode fmtMode) string
    FormatSym   func(*Sym, fmt.State, rune, int)  // orig: func symFormat(sym *Sym, s fmt.State, verb rune, mode fmtMode)
    FormatType  func(*Type, fmt.State, rune, int) // orig: func typeFormat(t *Type, s fmt.State, verb rune, mode fmtMode)
    TypeLinkSym func(*Type) *obj.LSym
    Ctxt        *obj.Link

    FmtLeft     int
    FmtUnsigned int
    FErr        int

The following variables must be initialized early by the frontend. They are here to break import cycles. TODO(gri) eliminate these dependencies.

var Block int32 // current block number
var InitSyms []*Sym

List of .inittask entries in imported packages, in source code order.

var NewPtrCacheEnabled = true

NewPtrCacheEnabled controls whether *T Types are cached in T. Caching is disabled just before starting the backend. This allows the backend to run concurrently.

var ParamsResults = [2]func(*Type) *Type{
    (*Type).Params, (*Type).Results,

ParamsResults is like RecvsParamsResults, but omits receiver parameters.

var RecvsParams = [2]func(*Type) *Type{
    (*Type).Recvs, (*Type).Params,

RecvsParams is like RecvsParamsResults, but omits result parameters.

var RecvsParamsResults = [3]func(*Type) *Type{
    (*Type).Recvs, (*Type).Params, (*Type).Results,

RecvsParamsResults stores the accessor functions for a function Type's receiver, parameters, and result parameters, in that order. It can be used to iterate over all of a function's parameter lists.

var Types [NTYPE]*Type

Types stores pointers to predeclared named types.

It also stores pointers to several special types:

- Types[TANY] is the placeholder "any" type recognized by substArgTypes.
- Types[TBLANK] represents the blank variable's type.
- Types[TNIL] represents the predeclared "nil" value's type.
- Types[TUNSAFEPTR] is package unsafe's Pointer type.

func CleanroomDo Uses

func CleanroomDo(f func())

CleanroomDo invokes f in an environment with no preexisting packages. For testing of import/export only.

func Identical Uses

func Identical(t1, t2 *Type) bool

Identical reports whether t1 and t2 are identical types, following the spec rules. Receiver parameter types are ignored.

func IdenticalIgnoreTags Uses

func IdenticalIgnoreTags(t1, t2 *Type) bool

IdenticalIgnoreTags is like Identical, but it ignores struct tags for struct identity.

func InternString Uses

func InternString(b []byte) string

func IsDclstackValid Uses

func IsDclstackValid() bool

func IsExported Uses

func IsExported(name string) bool

IsExported reports whether name is an exported Go symbol (that is, whether it begins with an upper-case letter).

func Markdcl Uses

func Markdcl()

Markdcl records the start of a new block scope for declarations.

func Popdcl Uses

func Popdcl()

Popdcl pops the innermost block scope and restores all symbol declarations to their previous state.

func Pushdcl Uses

func Pushdcl(s *Sym)

Pushdcl pushes the current declaration for symbol s (if any) so that it can be shadowed by a new declaration within a nested block scope.

type Array Uses

type Array struct {
    Elem  *Type // element type
    Bound int64 // number of elements; <0 if unknown yet

Array contains Type fields specific to array types.

type Chan Uses

type Chan struct {
    Elem *Type   // element type
    Dir  ChanDir // channel direction

Chan contains Type fields specific to channel types.

type ChanArgs Uses

type ChanArgs struct {
    T *Type // reference to a chan type whose elements need a width check

ChanArgs contains Type fields specific to TCHANARGS types.

type ChanDir Uses

type ChanDir uint8

ChanDir is whether a channel can send, receive, or both.

const (
    // types of channel
    // must match ../../../../reflect/type.go:/ChanDir
    Crecv ChanDir = 1 << 0
    Csend ChanDir = 1 << 1
    Cboth ChanDir = Crecv | Csend

func (ChanDir) CanRecv Uses

func (c ChanDir) CanRecv() bool

func (ChanDir) CanSend Uses

func (c ChanDir) CanSend() bool

type Cmp Uses

type Cmp int8

Cmp is a comparison between values a and b. -1 if a < b

0 if a == b
1 if a > b

type EType Uses

type EType uint8

EType describes a kind of type.

const (
    Txxx EType = iota






    // pseudo-types for literals
    TIDEAL // untyped numeric constants

    // pseudo-types for frame layout

    // SSA backend types
    TSSA   // internal types used by SSA backend (flags, memory, etc.)
    TTUPLE // a pair of types, used by SSA backend


func (EType) String Uses

func (i EType) String() string

type Field Uses

type Field struct {
    Embedded uint8 // embedded field

    Pos  src.XPos
    Sym  *Sym
    Type *Type  // field type
    Note string // literal string annotation

    // For fields that represent function parameters, Nname points
    // to the associated ONAME Node.
    Nname *Node

    // Offset in bytes of this field or method within its enclosing struct
    // or interface Type.
    Offset int64
    // contains filtered or unexported fields

A Field represents a field in a struct or a method in an interface or associated with a named type.

func NewField Uses

func NewField() *Field

func (*Field) Broke Uses

func (f *Field) Broke() bool

func (*Field) Copy Uses

func (f *Field) Copy() *Field

func (*Field) End Uses

func (f *Field) End() int64

End returns the offset of the first byte immediately after this field.

func (*Field) IsDDD Uses

func (f *Field) IsDDD() bool

func (*Field) IsMethod Uses

func (f *Field) IsMethod() bool

IsMethod reports whether f represents a method rather than a struct field.

func (*Field) Nointerface Uses

func (f *Field) Nointerface() bool

func (*Field) SetBroke Uses

func (f *Field) SetBroke(b bool)

func (*Field) SetIsDDD Uses

func (f *Field) SetIsDDD(b bool)

func (*Field) SetNointerface Uses

func (f *Field) SetNointerface(b bool)

type Fields Uses

type Fields struct {
    // contains filtered or unexported fields

Fields is a pointer to a slice of *Field. This saves space in Types that do not have fields or methods compared to a simple slice of *Field.

func (*Fields) Append Uses

func (f *Fields) Append(s ...*Field)

Append appends entries to f.

func (*Fields) Index Uses

func (f *Fields) Index(i int) *Field

Index returns the i'th element of Fields. It panics if f does not have at least i+1 elements.

func (*Fields) Len Uses

func (f *Fields) Len() int

Len returns the number of entries in f.

func (*Fields) Set Uses

func (f *Fields) Set(s []*Field)

Set sets f to a slice. This takes ownership of the slice.

func (*Fields) Slice Uses

func (f *Fields) Slice() []*Field

Slice returns the entries in f as a slice. Changes to the slice entries will be reflected in f.

type Forward Uses

type Forward struct {
    Copyto      []*Type  // where to copy the eventual value to
    Embedlineno src.XPos // first use of this type as an embedded type

Forward contains Type fields specific to forward types.

type Funarg Uses

type Funarg uint8

Fnstruct records the kind of function argument

const (
    FunargNone    Funarg = iota
    FunargRcvr           // receiver
    FunargParams         // input parameters
    FunargResults        // output results

type Func Uses

type Func struct {
    Receiver *Type // function receiver
    Results  *Type // function results
    Params   *Type // function params

    Nname *Node

    // Argwid is the total width of the function receiver, params, and results.
    // It gets calculated via a temporary TFUNCARGS type.
    // Note that TFUNC's Width is Widthptr.
    Argwid int64

    Outnamed bool
    // contains filtered or unexported fields

Func contains Type fields specific to func types.

type FuncArgs Uses

type FuncArgs struct {
    T *Type // reference to a func type whose elements need a width check

// FuncArgs contains Type fields specific to TFUNCARGS types.

type Interface Uses

type Interface struct {
    Fields Fields
    // contains filtered or unexported fields

Interface contains Type fields specific to interface types.

type Map Uses

type Map struct {
    Key  *Type // Key type
    Elem *Type // Val (elem) type

    Bucket *Type // internal struct type representing a hash bucket
    Hmap   *Type // internal struct type representing the Hmap (map header object)
    Hiter  *Type // internal struct type representing hash iterator state

Map contains Type fields specific to maps.

type Node Uses

type Node struct {
    // contains filtered or unexported fields

Dummy Node so we can refer to *Node without actually having a gc.Node. Necessary to break import cycles. TODO(gri) try to eliminate soon

type Pkg Uses

type Pkg struct {
    Path    string // string literal used in import statement, e.g. "runtime/internal/sys"
    Name    string // package name, e.g. "sys"
    Prefix  string // escaped path for use in symbol table
    Syms    map[string]*Sym
    Pathsym *obj.LSym

    // Height is the package's height in the import graph. Leaf
    // packages (i.e., packages with no imports) have height 0,
    // and all other packages have height 1 plus the maximum
    // height of their imported packages.
    Height int

    Imported bool // export data of this package was parsed
    Direct   bool // imported directly

func ImportedPkgList Uses

func ImportedPkgList() []*Pkg

ImportedPkgList returns the list of directly imported packages. The list is sorted by package path.

func NewPkg Uses

func NewPkg(path, name string) *Pkg

NewPkg returns a new Pkg for the given package path and name. Unless name is the empty string, if the package exists already, the existing package name and the provided name must match.

func (*Pkg) Lookup Uses

func (pkg *Pkg) Lookup(name string) *Sym

func (*Pkg) LookupBytes Uses

func (pkg *Pkg) LookupBytes(name []byte) *Sym

func (*Pkg) LookupOK Uses

func (pkg *Pkg) LookupOK(name string) (s *Sym, existed bool)

LookupOK looks up name in pkg and reports whether it previously existed.

type Ptr Uses

type Ptr struct {
    Elem *Type // element type

Ptr contains Type fields specific to pointer types.

type Slice Uses

type Slice struct {
    Elem *Type // element type

Slice contains Type fields specific to slice types.

type Struct Uses

type Struct struct {

    // Maps have three associated internal structs (see struct MapType).
    // Map links such structs back to their map type.
    Map *Type

    Funarg Funarg // type of function arguments for arg struct
    // contains filtered or unexported fields

StructType contains Type fields specific to struct types.

type Sym Uses

type Sym struct {
    Importdef *Pkg   // where imported definition was found
    Linkname  string // link name

    Pkg  *Pkg
    Name string // object name

    // saved and restored by dcopy
    Def        *Node    // definition: ONAME OTYPE OPACK or OLITERAL
    Block      int32    // blocknumber to catch redeclaration
    Lastlineno src.XPos // last declaration for diagnostic

    Label   *Node // corresponding label (ephemeral)
    Origpkg *Pkg  // original package for . import
    // contains filtered or unexported fields

Sym represents an object name in a segmented (pkg, name) namespace. Most commonly, this is a Go identifier naming an object declared within a package, but Syms are also used to name internal synthesized objects.

As an exception, field and method names that are exported use the Sym associated with localpkg instead of the package that declared them. This allows using Sym pointer equality to test for Go identifier uniqueness when handling selector expressions.

Ideally, Sym should be used for representing Go language constructs, while cmd/internal/obj.LSym is used for representing emitted artifacts.

NOTE: In practice, things can be messier than the description above for various reasons (historical, convenience).

func (*Sym) Asm Uses

func (sym *Sym) Asm() bool

func (*Sym) Format Uses

func (sym *Sym) Format(s fmt.State, verb rune)

func (*Sym) Func Uses

func (sym *Sym) Func() bool

func (*Sym) IsBlank Uses

func (sym *Sym) IsBlank() bool

func (*Sym) Less Uses

func (a *Sym) Less(b *Sym) bool

Less reports whether symbol a is ordered before symbol b.

Symbols are ordered exported before non-exported, then by name, and finally (for non-exported symbols) by package height and path.

Ordering by package height is necessary to establish a consistent ordering for non-exported names with the same spelling but from different packages. We don't necessarily know the path for the package being compiled, but by definition it will have a height greater than any other packages seen within the compilation unit. For more background, see issue #24693.

func (*Sym) Linksym Uses

func (sym *Sym) Linksym() *obj.LSym

func (*Sym) LinksymName Uses

func (sym *Sym) LinksymName() string

func (*Sym) OnExportList Uses

func (sym *Sym) OnExportList() bool

func (*Sym) PkgDef Uses

func (s *Sym) PkgDef() *Node

PkgDef returns the definition associated with s at package scope.

func (*Sym) SetAsm Uses

func (sym *Sym) SetAsm(b bool)

func (*Sym) SetFunc Uses

func (sym *Sym) SetFunc(b bool)

func (*Sym) SetOnExportList Uses

func (sym *Sym) SetOnExportList(b bool)

func (*Sym) SetPkgDef Uses

func (s *Sym) SetPkgDef(n *Node)

SetPkgDef sets the definition associated with s at package scope.

func (*Sym) SetSiggen Uses

func (sym *Sym) SetSiggen(b bool)

func (*Sym) SetUniq Uses

func (sym *Sym) SetUniq(b bool)

func (*Sym) Siggen Uses

func (sym *Sym) Siggen() bool

func (*Sym) String Uses

func (s *Sym) String() string

func (*Sym) Uniq Uses

func (sym *Sym) Uniq() bool

type Tuple Uses

type Tuple struct {
    // contains filtered or unexported fields

type Type Uses

type Type struct {
    // Extra contains extra etype-specific fields.
    // As an optimization, those etype-specific structs which contain exactly
    // one pointer-shaped field are stored as values rather than pointers when possible.
    // TMAP: *Map
    // TFORW: *Forward
    // TFUNC: *Func
    // TSTRUCT: *Struct
    // TINTER: *Interface
    // TFUNCARGS: FuncArgs
    // TCHANARGS: ChanArgs
    // TCHAN: *Chan
    // TPTR: Ptr
    // TARRAY: *Array
    // TSLICE: Slice
    Extra interface{}

    // Width is the width of this Type in bytes.
    Width int64 // valid if Align > 0

    Nod  *Node // canonical OTYPE node
    Orig *Type // original type (type literal or predefined type)

    // Cache of composite types, with this type being the element type.
    Cache struct {
        // contains filtered or unexported fields

    Sym    *Sym  // symbol containing name, for named types
    Vargen int32 // unique name for OTYPE/ONAME

    Etype EType // kind of type
    Align uint8 // the required alignment of this type, in bytes (0 means Width and Align have not yet been computed)
    // contains filtered or unexported fields

A Type represents a Go type.

func FakeRecvType Uses

func FakeRecvType() *Type

FakeRecvType returns the singleton type used for interface method receivers.

func New Uses

func New(et EType) *Type

New returns a new Type of the specified kind.

func NewArray Uses

func NewArray(elem *Type, bound int64) *Type

NewArray returns a new fixed-length array Type.

func NewChan Uses

func NewChan(elem *Type, dir ChanDir) *Type

NewChan returns a new chan Type with direction dir.

func NewChanArgs Uses

func NewChanArgs(c *Type) *Type

NewChanArgs returns a new TCHANARGS type for channel type c.

func NewFuncArgs Uses

func NewFuncArgs(f *Type) *Type

NewFuncArgs returns a new TFUNCARGS type for func type f.

func NewMap Uses

func NewMap(k, v *Type) *Type

NewMap returns a new map Type with key type k and element (aka value) type v.

func NewPtr Uses

func NewPtr(elem *Type) *Type

NewPtr returns the pointer type pointing to t.

func NewSlice Uses

func NewSlice(elem *Type) *Type

NewSlice returns the slice Type with element type elem.

func NewTuple Uses

func NewTuple(t1, t2 *Type) *Type

func SubstAny Uses

func SubstAny(t *Type, types *[]*Type) *Type

SubstAny walks t, replacing instances of "any" with successive elements removed from types. It returns the substituted type.

func (*Type) Alignment Uses

func (t *Type) Alignment() int64

func (*Type) AllMethods Uses

func (t *Type) AllMethods() *Fields

func (*Type) ArgWidth Uses

func (t *Type) ArgWidth() int64

ArgWidth returns the total aligned argument size for a function. It includes the receiver, parameters, and results.

func (*Type) Broke Uses

func (t *Type) Broke() bool

func (*Type) ChanArgs Uses

func (t *Type) ChanArgs() *Type

ChanArgs returns the channel type for TCHANARGS type t.

func (*Type) ChanDir Uses

func (t *Type) ChanDir() ChanDir

ChanDir returns the direction of a channel type t. The direction will be one of Crecv, Csend, or Cboth.

func (*Type) ChanType Uses

func (t *Type) ChanType() *Chan

ChanType returns t's extra channel-specific fields.

func (*Type) Compare Uses

func (t *Type) Compare(x *Type) Cmp

Compare compares types for purposes of the SSA back end, returning a Cmp (one of CMPlt, CMPeq, CMPgt). The answers are correct for an optimizer or code generator, but not necessarily typechecking. The order chosen is arbitrary, only consistency and division into equivalence classes (Types that compare CMPeq) matters.

func (*Type) Deferwidth Uses

func (t *Type) Deferwidth() bool

func (*Type) Elem Uses

func (t *Type) Elem() *Type

Elem returns the type of elements of t. Usable with pointers, channels, arrays, slices, and maps.

func (*Type) Field Uses

func (t *Type) Field(i int) *Field

Field returns the i'th field/method of struct/interface type t.

func (*Type) FieldName Uses

func (t *Type) FieldName(i int) string

func (*Type) FieldOff Uses

func (t *Type) FieldOff(i int) int64

func (*Type) FieldSlice Uses

func (t *Type) FieldSlice() []*Field

FieldSlice returns a slice of containing all fields/methods of struct/interface type t.

func (*Type) FieldType Uses

func (t *Type) FieldType(i int) *Type

func (*Type) Fields Uses

func (t *Type) Fields() *Fields

func (*Type) Format Uses

func (t *Type) Format(s fmt.State, verb rune)

func (*Type) ForwardType Uses

func (t *Type) ForwardType() *Forward

ForwardType returns t's extra forward-type-specific fields.

func (*Type) FuncArgs Uses

func (t *Type) FuncArgs() *Type

FuncArgs returns the func type for TFUNCARGS type t.

func (*Type) FuncType Uses

func (t *Type) FuncType() *Func

FuncType returns t's extra func-specific fields.

func (*Type) HasNil Uses

func (t *Type) HasNil() bool

HasNil reports whether the set of values determined by t includes nil.

func (*Type) HasPointers Uses

func (t *Type) HasPointers() bool

HasPointers reports whether t contains a heap pointer. Note that this function ignores pointers to go:notinheap types.

func (*Type) IsArray Uses

func (t *Type) IsArray() bool

func (*Type) IsBoolean Uses

func (t *Type) IsBoolean() bool

func (*Type) IsChan Uses

func (t *Type) IsChan() bool

func (*Type) IsComplex Uses

func (t *Type) IsComplex() bool

func (*Type) IsEmptyInterface Uses

func (t *Type) IsEmptyInterface() bool

IsEmptyInterface reports whether t is an empty interface type.

func (*Type) IsFlags Uses

func (t *Type) IsFlags() bool

func (*Type) IsFloat Uses

func (t *Type) IsFloat() bool

func (*Type) IsFuncArgStruct Uses

func (t *Type) IsFuncArgStruct() bool

IsFuncArgStruct reports whether t is a struct representing function parameters.

func (*Type) IsInteger Uses

func (t *Type) IsInteger() bool

func (*Type) IsInterface Uses

func (t *Type) IsInterface() bool

func (*Type) IsKind Uses

func (t *Type) IsKind(et EType) bool

IsKind reports whether t is a Type of the specified kind.

func (*Type) IsMap Uses

func (t *Type) IsMap() bool

func (*Type) IsMemory Uses

func (t *Type) IsMemory() bool

func (*Type) IsPtr Uses

func (t *Type) IsPtr() bool

IsPtr reports whether t is a regular Go pointer type. This does not include unsafe.Pointer.

func (*Type) IsPtrElem Uses

func (t *Type) IsPtrElem() bool

IsPtrElem reports whether t is the element of a pointer (to t).

func (*Type) IsPtrShaped Uses

func (t *Type) IsPtrShaped() bool

IsPtrShaped reports whether t is represented by a single machine pointer. In addition to regular Go pointer types, this includes map, channel, and function types and unsafe.Pointer. It does not include array or struct types that consist of a single pointer shaped type. TODO(mdempsky): Should it? See golang.org/issue/15028.

func (*Type) IsSigned Uses

func (t *Type) IsSigned() bool

func (*Type) IsSlice Uses

func (t *Type) IsSlice() bool

func (*Type) IsString Uses

func (t *Type) IsString() bool

func (*Type) IsStruct Uses

func (t *Type) IsStruct() bool

func (*Type) IsTuple Uses

func (t *Type) IsTuple() bool

func (*Type) IsUnsafePtr Uses

func (t *Type) IsUnsafePtr() bool

IsUnsafePtr reports whether t is an unsafe pointer.

func (*Type) IsUntyped Uses

func (t *Type) IsUntyped() bool

IsUntyped reports whether t is an untyped type.

func (*Type) IsVariadic Uses

func (t *Type) IsVariadic() bool

IsVariadic reports whether function type t is variadic.

func (*Type) IsVoid Uses

func (t *Type) IsVoid() bool

func (*Type) Key Uses

func (t *Type) Key() *Type

Key returns the key type of map type t.

func (*Type) LongString Uses

func (t *Type) LongString() string

LongString generates a complete description of t. It is useful for reflection, or when a unique fingerprint or hash of a type is required.

func (*Type) MapType Uses

func (t *Type) MapType() *Map

MapType returns t's extra map-specific fields.

func (*Type) Methods Uses

func (t *Type) Methods() *Fields

func (*Type) Nname Uses

func (t *Type) Nname() *Node

Nname returns the associated function's nname.

func (*Type) Noalg Uses

func (t *Type) Noalg() bool

func (*Type) NotInHeap Uses

func (t *Type) NotInHeap() bool

func (*Type) NumComponents Uses

func (t *Type) NumComponents(countBlank componentsIncludeBlankFields) int64

NumComponents returns the number of primitive elements that compose t. Struct and array types are flattened for the purpose of counting. All other types (including string, slice, and interface types) count as one element. If countBlank is IgnoreBlankFields, then blank struct fields (and their comprised elements) are excluded from the count. struct { x, y [3]int } has six components; [10]struct{ x, y string } has twenty.

func (*Type) NumElem Uses

func (t *Type) NumElem() int64

func (*Type) NumFields Uses

func (t *Type) NumFields() int

func (*Type) NumParams Uses

func (t *Type) NumParams() int

func (*Type) NumRecvs Uses

func (t *Type) NumRecvs() int

func (*Type) NumResults Uses

func (t *Type) NumResults() int

func (*Type) Params Uses

func (t *Type) Params() *Type

func (*Type) Pkg Uses

func (t *Type) Pkg() *Pkg

Pkg returns the package that t appeared in.

Pkg is only defined for function, struct, and interface types (i.e., types with named elements). This information isn't used by cmd/compile itself, but we need to track it because it's exposed by the go/types API.

func (*Type) PtrTo Uses

func (t *Type) PtrTo() *Type

func (*Type) Recur Uses

func (t *Type) Recur() bool

func (*Type) Recv Uses

func (t *Type) Recv() *Field

Recv returns the receiver of function type t, if any.

func (*Type) Recvs Uses

func (t *Type) Recvs() *Type

func (*Type) Results Uses

func (t *Type) Results() *Type

func (*Type) SetBroke Uses

func (t *Type) SetBroke(b bool)

func (*Type) SetDeferwidth Uses

func (t *Type) SetDeferwidth(b bool)

func (*Type) SetFields Uses

func (t *Type) SetFields(fields []*Field)

SetFields sets struct/interface type t's fields/methods to fields.

func (*Type) SetInterface Uses

func (t *Type) SetInterface(methods []*Field)

func (*Type) SetNname Uses

func (t *Type) SetNname(n *Node)

Nname sets the associated function's nname.

func (*Type) SetNoalg Uses

func (t *Type) SetNoalg(b bool)

func (*Type) SetNotInHeap Uses

func (t *Type) SetNotInHeap(b bool)

func (*Type) SetPkg Uses

func (t *Type) SetPkg(pkg *Pkg)

SetPkg sets the package that t appeared in.

func (*Type) SetRecur Uses

func (t *Type) SetRecur(b bool)

func (*Type) ShortString Uses

func (t *Type) ShortString() string

ShortString generates a short description of t. It is used in autogenerated method names, reflection, and itab names.

func (*Type) SimpleString Uses

func (t *Type) SimpleString() string

func (*Type) Size Uses

func (t *Type) Size() int64

func (*Type) SoleComponent Uses

func (t *Type) SoleComponent() *Type

SoleComponent returns the only primitive component in t, if there is exactly one. Otherwise, it returns nil. Components are counted as in NumComponents, including blank fields.

func (*Type) String Uses

func (t *Type) String() string

func (*Type) StructType Uses

func (t *Type) StructType() *Struct

StructType returns t's extra struct-specific fields.

func (*Type) Symbol Uses

func (t *Type) Symbol() *obj.LSym

func (*Type) Tie Uses

func (t *Type) Tie() byte

Tie returns 'T' if t is a concrete type, 'I' if t is an interface type, and 'E' if t is an empty interface type. It is used to build calls to the conv* and assert* runtime routines.

func (*Type) ToUnsigned Uses

func (t *Type) ToUnsigned() *Type

ToUnsigned returns the unsigned equivalent of integer type t.

func (*Type) WidthCalculated Uses

func (t *Type) WidthCalculated() bool

Package types imports 9 packages (graph) and is imported by 23 packages. Updated 2020-12-04. Refresh now. Tools for package owners.