abi

package
v0.9.8 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BUCKETSIZE  = abi.MapBucketCount
	MAXKEYSIZE  = abi.MapMaxKeyBytes
	MAXELEMSIZE = abi.MapMaxElemBytes
)

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 (
	PatchPathPrefix = "github.com/goplus/llgo/internal/lib/"
)

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 added in v0.8.10

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 added in v0.9.0

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 IsReflexive added in v0.9.0

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 v0.9.0

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

MapBucketType makes the map bucket type given the type of the map.

func MapTypeFlags added in v0.9.0

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

func NamedName added in v0.9.7

func NamedName(t *types.Named) string

func PathOf

func PathOf(pkg *types.Package) string

PathOf returns the package path of the specified package.

func TypeArgs added in v0.9.7

func TypeArgs(typeArgs []types.Type) string

func TypeName

func TypeName(o *types.TypeName) string

TypeName returns the ABI type name for the specified named type.

func UnderlyingKind

func UnderlyingKind(t types.Type) abi.Kind

Types

type Builder

type Builder struct {
	Pkg string
	// contains filtered or unexported fields
}

Builder is a helper for constructing ABI types.

func New

func New(pkg string) *Builder

New creates a new ABI type Builder.

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(pkg string)

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) 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) 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