rttype

Imports

Imports #

"cmd/compile/internal/base"
"cmd/compile/internal/objw"
"cmd/compile/internal/types"
"cmd/internal/obj"
"internal/abi"
"reflect"

Constants & Variables

ArrayType var #

var ArrayType *types.Type

ChanType var #

var ChanType *types.Type

FuncType var #

var FuncType *types.Type

IMethod var #

Types that are parts of the types above.

var IMethod *types.Type

ITab var #

Interface tables (itabs)

var ITab *types.Type

InterfaceSwitch var #

Type switches and asserts

var InterfaceSwitch *types.Type

InterfaceType var #

var InterfaceType *types.Type

Method var #

var Method *types.Type

OldMapType var #

var OldMapType *types.Type

PtrType var #

var PtrType *types.Type

SliceType var #

var SliceType *types.Type

StructField var #

var StructField *types.Type

StructType var #

var StructType *types.Type

SwissMapType var #

var SwissMapType *types.Type

Type var #

The type structures shared with the runtime.

var Type *types.Type

TypeAssert var #

var TypeAssert *types.Type

UncommonType var #

var UncommonType *types.Type

Structs

ArrayCursor struct #

type ArrayCursor struct {
c Cursor
n int
}

Cursor struct #

A Cursor represents a typed location inside a static variable where we are going to write.

type Cursor struct {
lsym *obj.LSym
offset int64
typ *types.Type
}

Functions

Elem method #

Elem selects element i of the array pointed to by c.

func (a ArrayCursor) Elem(i int) Cursor

Elem method #

func (c Cursor) Elem(i int64) Cursor

Field method #

Field selects the field with the given name from the struct pointed to by c.

func (c Cursor) Field(name string) Cursor

Init function #

func Init()

ModifyArray method #

ModifyArray converts a cursor pointing at a type [k]T to a cursor pointing at a type [n]T. Also returns the size delta, aka (n-k)*sizeof(T).

func (c Cursor) ModifyArray(n int) (ArrayCursor, int64)

NewArrayCursor function #

NewArrayCursor returns a cursor starting at lsym+off and having n copies of type t.

func NewArrayCursor(lsym *obj.LSym, off int64, t *types.Type, n int) ArrayCursor

NewCursor function #

NewCursor returns a cursor starting at lsym+off and having type t.

func NewCursor(lsym *obj.LSym, off int64, t *types.Type) Cursor

Reloc method #

Reloc adds a relocation from the current cursor position. Reloc fills in Off and Siz fields. Caller should fill in the rest (Type, others).

func (c Cursor) Reloc(rel obj.Reloc)

WriteBool method #

func (c Cursor) WriteBool(val bool)

WriteInt method #

func (c Cursor) WriteInt(val int64)

WriteInt32 method #

func (c Cursor) WriteInt32(val int32)

WritePtr method #

WritePtr writes a pointer "target" to the component at the location specified by c.

func (c Cursor) WritePtr(target *obj.LSym)

WritePtrWeak method #

func (c Cursor) WritePtrWeak(target *obj.LSym)

WriteSlice method #

WriteSlice writes a slice header to c. The pointer is target+off, the len and cap fields are given.

func (c Cursor) WriteSlice(target *obj.LSym, off int64, len int64, cap int64)

WriteSymPtrOff method #

WriteSymPtrOff writes a "pointer" to the given symbol. The symbol is encoded as a uint32 offset from the start of the section.

func (c Cursor) WriteSymPtrOff(target *obj.LSym, weak bool)

WriteUint16 method #

func (c Cursor) WriteUint16(val uint16)

WriteUint32 method #

func (c Cursor) WriteUint32(val uint32)

WriteUint8 method #

func (c Cursor) WriteUint8(val uint8)

WriteUintptr method #

func (c Cursor) WriteUintptr(val uint64)

fromReflect function #

fromReflect translates from a host type to the equivalent target type.

func fromReflect(rt reflect.Type) *types.Type

reflectToType function #

reflectToType converts from a reflect.Type (which is a compiler host type) to a *types.Type, which is a target type. The result must be CalcSize'd before using.

func reflectToType(rt reflect.Type) *types.Type

Generated with Arrow