abi

package
v1.0.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 21, 2026 License: Apache-2.0 Imports: 11 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	PatchPathPrefix = env.LLGoRuntimePkg + "/internal/lib/"
	ForTestMarker   = "@ForTest"
)
View Source
const (
	BUCKETSIZE  = abi.MapBucketCount
	MAXKEYSIZE  = abi.MapMaxKeyBytes
	MAXELEMSIZE = abi.MapMaxElemBytes
	ZeroValSize = abi.ZeroValSize
)

Builds a type representing a Bucket structure for the given map type. This type is not visible to users - we include only enough information to generate a correct GC program for it. Make sure this stays in sync with runtime/map.go.

A "bucket" is a "struct" {
      tophash [BUCKETSIZE]uint8
      keys [BUCKETSIZE]keyType
      elems [BUCKETSIZE]elemType
      overflow *bucket
    }
View Source
const (
	TFlagUncommon   = abi.TFlagUncommon
	KindDirectIface = abi.KindDirectIface
)

Variables

This section is empty.

Functions

func BasicKind

func BasicKind(t *types.Basic) abi.Kind

func BasicName

func BasicName(t *types.Basic) string

BasicName returns the ABI type name for the specified basic type.

func ChanDir

func ChanDir(dir types.ChanDir) (abi.ChanDir, string)

func FullName

func FullName(pkg *types.Package, name string) string

FullName returns the full name of a package member.

func HasPtrData

func HasPtrData(t types.Type) bool

PtrDataSize returns the length in bytes of the prefix of t containing pointer data. Anything after this offset is scalar data.

PtrDataSize is only defined for actual Go types. It's an error to use it on compiler-internal types (e.g., TSSA, TRESULTS).

func IsClosure

func IsClosure(raw *types.Struct) bool

func IsClosureFields

func IsClosureFields(fields []*types.Var) bool

func IsReflexive

func IsReflexive(t types.Type) bool

IsReflexive reports whether t has a reflexive equality operator. That is, if x==x for all x of type t.

func MapBucketType added in v1.0.7

func MapBucketType(t *types.Map, sizes types.Sizes) types.Type

MapBucketType shares the collector's actual bucket layout with DWARF.

func MapTypeFlags

func MapTypeFlags(t *types.Map, sizes types.Sizes) (flags int)

func NamedName

func NamedName(t *types.Named) string

func PathOf

func PathOf(pkg *types.Package) string

PathOf returns the package path of the specified package.

func PublicType

func PublicType(t types.Type) types.Type

PublicType maps LLGo's internal closure representation back to the source function type when emitting reflected type names and type references. It must not be used for physical layout computations such as size, align, or offsets.

func TypeArgs

func TypeArgs(typeArgs []types.Type) string

func UnderlyingKind

func UnderlyingKind(t types.Type) abi.Kind

Types

type Builder

type Builder struct {
	PtrSize uintptr
	Sizes   types.Sizes
	// contains filtered or unexported fields
}

Builder is a helper for constructing ABI types.

func New

func New(ptrSize uintptr, sizes types.Sizes) *Builder

New creates a new ABI type Builder.

func (*Builder) Align

func (b *Builder) Align(t types.Type) uintptr

func (*Builder) EqualName

func (b *Builder) EqualName(t types.Type) string

func (*Builder) FieldAlign

func (b *Builder) FieldAlign(t types.Type) uintptr

func (*Builder) FuncName

func (b *Builder) FuncName(t *types.Signature) string

FuncName returns the ABI type name for the specified function type.

func (*Builder) Init

func (b *Builder) Init(ptrSize uintptr, sizes types.Sizes)

func (*Builder) InterfaceName

func (b *Builder) InterfaceName(t *types.Interface) (ret string, pub bool)

InterfaceName returns the ABI type name for the specified interface type.

func (*Builder) IsRegularMemory

func (b *Builder) IsRegularMemory(t types.Type) bool

func (*Builder) Kind

func (b *Builder) Kind(t types.Type) abi.Kind

func (*Builder) MapBucket

func (b *Builder) MapBucket(t *types.Map) types.Type

func (*Builder) MapFlags

func (b *Builder) MapFlags(t *types.Map) (flags int)

func (*Builder) PtrBytes

func (b *Builder) PtrBytes(t types.Type) uintptr

func (*Builder) RuntimeName

func (b *Builder) RuntimeName(t types.Type) string

func (*Builder) Size

func (b *Builder) Size(t types.Type) uintptr

func (*Builder) Str

func (b *Builder) Str(t types.Type) string

func (*Builder) StructName

func (b *Builder) StructName(t *types.Struct) (ret string, pub bool)

StructName returns the ABI type name for the specified struct type.

func (*Builder) TFlag

func (b *Builder) TFlag(t types.Type) (flag abi.TFlag)

func (*Builder) TypeName

func (b *Builder) TypeName(t types.Type) (ret string, pub bool)

TypeName returns the ABI type name for the specified type.

type DataKind

type DataKind int
const (
	Invalid  DataKind = iota
	Indirect          // allocate memory for the value
	Pointer           // store a pointer value directly in the interface value
	Integer           // store a integer value directly in the interface value
	BitCast           // store other value (need bitcast) directly in the interface value
)

func DataKindOf

func DataKindOf(raw types.Type, lvl int, is32Bits bool) (DataKind, types.Type, int)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL