var ArrayType *types.Type
var ChanType *types.Type
var FuncType *types.Type
Types that are parts of the types above.
var IMethod *types.Type
Interface tables (itabs)
var ITab *types.Type
Type switches and asserts
var InterfaceSwitch *types.Type
var InterfaceType *types.Type
var MapType *types.Type
var Method *types.Type
var PtrType *types.Type
var SliceType *types.Type
var StructField *types.Type
var StructType *types.Type
The type structures shared with the runtime.
var Type *types.Type
var TypeAssert *types.Type
var UncommonType *types.Type
func Init()
type ArrayCursor struct {
// contains filtered or unexported fields
}
func NewArrayCursor(lsym *obj.LSym, off int64, t *types.Type, n int) ArrayCursor
NewArrayCursor returns a cursor starting at lsym+off and having n copies of type t.
func (a ArrayCursor) Elem(i int) Cursor
Elem selects element i of the array pointed to by c.
A Cursor represents a typed location inside a static variable where we are going to write.
type Cursor struct {
// contains filtered or unexported fields
}
func NewCursor(lsym *obj.LSym, off int64, t *types.Type) Cursor
NewCursor returns a cursor starting at lsym+off and having type t.
func (c Cursor) Elem(i int64) Cursor
func (c Cursor) Field(name string) Cursor
Field selects the field with the given name from the struct pointed to by c.
func (c Cursor) ModifyArray(n int) (ArrayCursor, int64)
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) Reloc() *obj.Reloc
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) WriteBool(val bool)
func (c Cursor) WriteInt(val int64)
func (c Cursor) WriteInt32(val int32)
func (c Cursor) WritePtr(target *obj.LSym)
WritePtr writes a pointer "target" to the component at the location specified by c.
func (c Cursor) WritePtrWeak(target *obj.LSym)
func (c Cursor) WriteSlice(target *obj.LSym, off, len, cap int64)
WriteSlice writes a slice header to c. The pointer is target+off, the len and cap fields are given.
func (c Cursor) WriteSymPtrOff(target *obj.LSym, weak bool)
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) WriteUint16(val uint16)
func (c Cursor) WriteUint32(val uint32)
func (c Cursor) WriteUint8(val uint8)
func (c Cursor) WriteUintptr(val uint64)