cabi

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2026 License: Apache-2.0 Imports: 5 Imported by: 0 modules, 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 (
	MABI_LP64  = "lp64"
	MABI_LP64F = "lp64f"
	MABI_LP64D = "lp64d"
)
View Source
const (
	MABI_ILP32  = "ilp32"
	MABI_ILP32F = "ilp32f"
	MABI_ILP32D = "ilp32d"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AttrKind

type AttrKind int
const (
	AttrNone       AttrKind = iota // keep org type
	AttrVoid                       // return type void / param type void (size == 0) skip
	AttrPointer                    // type => type*
	AttrWidthType                  // type => width int i16/i24/i32/i40/i48/i56/i64 float/double
	AttrWidthType2                 // type => width two int {i64,i16} float/double
	AttrExtract                    // extract struct type
)

type CallInstr

type CallInstr struct {
	// contains filtered or unexported fields
}

type FuncInfo

type FuncInfo struct {
	Type   llvm.Type   // func type
	Return *TypeInfo   // return info
	Params []*TypeInfo // params info
}

func (*FuncInfo) HasWrap

func (p *FuncInfo) HasWrap() bool

type Transformer

type Transformer struct {
	// contains filtered or unexported fields
}

func NewTransformer

func NewTransformer(prog ssa.Program, llvmTarget string, targetAbi string, optimize bool) *Transformer

func (*Transformer) Alignof

func (p *Transformer) Alignof(typ llvm.Type) int

func (*Transformer) GetFuncInfo

func (p *Transformer) GetFuncInfo(ctx llvm.Context, typ llvm.Type) (info FuncInfo)

func (*Transformer) GetTypeInfo

func (p *Transformer) GetTypeInfo(ctx llvm.Context, ftyp llvm.Type, typ llvm.Type, index int) *TypeInfo

func (*Transformer) IsWrapType

func (p *Transformer) IsWrapType(ctx llvm.Context, ftyp llvm.Type, typ llvm.Type, index int) bool

func (*Transformer) SetSkipFuncs

func (p *Transformer) SetSkipFuncs(names []string)

SetSkipFuncs configures function full names that should not be transformed. Names are LLVM symbol names (for example, "internal/bytealg.Compare"). The list is applied to both function signature rewriting and call-site rewriting.

func (*Transformer) Sizeof

func (p *Transformer) Sizeof(typ llvm.Type) int

func (*Transformer) TransformModule

func (p *Transformer) TransformModule(path string, m llvm.Module)

type TypeInfo

type TypeInfo struct {
	Type       llvm.Type
	NativeType llvm.Type // native aggregate layout when it differs from Type
	Kind       AttrKind
	Type1      llvm.Type // AttrWidthType
	Type2      llvm.Type // AttrWidthType2
	Size       int
	Align      int
	ByValAlign int // explicit stack alignment for AttrPointer parameters
}

type TypeInfo386

type TypeInfo386 struct {
	*Transformer
}

func (*TypeInfo386) GetTypeInfo

func (p *TypeInfo386) GetTypeInfo(ctx llvm.Context, ftyp llvm.Type, typ llvm.Type, index int) *TypeInfo

func (*TypeInfo386) IsWrapType

func (p *TypeInfo386) IsWrapType(ctx llvm.Context, ftyp llvm.Type, typ llvm.Type, index int) bool

func (*TypeInfo386) SkipEmptyParams

func (p *TypeInfo386) SkipEmptyParams() bool

func (*TypeInfo386) SupportByVal

func (p *TypeInfo386) SupportByVal() bool

type TypeInfoAmd64

type TypeInfoAmd64 struct {
	*Transformer
}

func (*TypeInfoAmd64) GetTypeInfo

func (p *TypeInfoAmd64) GetTypeInfo(ctx llvm.Context, ftyp llvm.Type, typ llvm.Type, index int) *TypeInfo

func (*TypeInfoAmd64) IsWrapType

func (p *TypeInfoAmd64) IsWrapType(ctx llvm.Context, ftyp llvm.Type, typ llvm.Type, index int) bool

func (*TypeInfoAmd64) SkipEmptyParams

func (p *TypeInfoAmd64) SkipEmptyParams() bool

func (*TypeInfoAmd64) SupportByVal

func (p *TypeInfoAmd64) SupportByVal() bool

type TypeInfoArm

type TypeInfoArm struct {
	*Transformer
}

func (*TypeInfoArm) GetTypeInfo

func (p *TypeInfoArm) GetTypeInfo(ctx llvm.Context, ftyp llvm.Type, typ llvm.Type, index int) *TypeInfo

func (*TypeInfoArm) IsWrapType

func (p *TypeInfoArm) IsWrapType(ctx llvm.Context, ftyp llvm.Type, typ llvm.Type, index int) bool

func (*TypeInfoArm) SkipEmptyParams

func (p *TypeInfoArm) SkipEmptyParams() bool

func (*TypeInfoArm) SupportByVal

func (p *TypeInfoArm) SupportByVal() bool

type TypeInfoArm64

type TypeInfoArm64 struct {
	*Transformer
}

func (*TypeInfoArm64) GetTypeInfo

func (p *TypeInfoArm64) GetTypeInfo(ctx llvm.Context, ftyp llvm.Type, typ llvm.Type, index int) *TypeInfo

func (*TypeInfoArm64) IsWrapType

func (p *TypeInfoArm64) IsWrapType(ctx llvm.Context, ftyp llvm.Type, typ llvm.Type, index int) bool

func (*TypeInfoArm64) SkipEmptyParams

func (p *TypeInfoArm64) SkipEmptyParams() bool

func (*TypeInfoArm64) SupportByVal

func (p *TypeInfoArm64) SupportByVal() bool

type TypeInfoEsp32

type TypeInfoEsp32 struct {
	*Transformer
}

func (*TypeInfoEsp32) GetTypeInfo

func (p *TypeInfoEsp32) GetTypeInfo(ctx llvm.Context, ftyp llvm.Type, typ llvm.Type, index int) *TypeInfo

func (*TypeInfoEsp32) IsWrapType

func (p *TypeInfoEsp32) IsWrapType(ctx llvm.Context, ftyp llvm.Type, typ llvm.Type, index int) bool

func (*TypeInfoEsp32) SkipEmptyParams

func (p *TypeInfoEsp32) SkipEmptyParams() bool

func (*TypeInfoEsp32) SupportByVal

func (p *TypeInfoEsp32) SupportByVal() bool

type TypeInfoRiscv32

type TypeInfoRiscv32 struct {
	*Transformer
	// contains filtered or unexported fields
}

func (*TypeInfoRiscv32) GetTypeInfo

func (p *TypeInfoRiscv32) GetTypeInfo(ctx llvm.Context, ftyp llvm.Type, typ llvm.Type, index int) *TypeInfo

func (*TypeInfoRiscv32) IsWrapType

func (p *TypeInfoRiscv32) IsWrapType(ctx llvm.Context, ftyp llvm.Type, typ llvm.Type, index int) bool

func (*TypeInfoRiscv32) SkipEmptyParams

func (p *TypeInfoRiscv32) SkipEmptyParams() bool

func (*TypeInfoRiscv32) SupportByVal

func (p *TypeInfoRiscv32) SupportByVal() bool

type TypeInfoRiscv64

type TypeInfoRiscv64 struct {
	*Transformer
	// contains filtered or unexported fields
}

func (*TypeInfoRiscv64) GetTypeInfo

func (p *TypeInfoRiscv64) GetTypeInfo(ctx llvm.Context, ftyp llvm.Type, typ llvm.Type, index int) *TypeInfo

func (*TypeInfoRiscv64) IsWrapType

func (p *TypeInfoRiscv64) IsWrapType(ctx llvm.Context, ftyp llvm.Type, typ llvm.Type, index int) bool

func (*TypeInfoRiscv64) SkipEmptyParams

func (p *TypeInfoRiscv64) SkipEmptyParams() bool

func (*TypeInfoRiscv64) SupportByVal

func (p *TypeInfoRiscv64) SupportByVal() bool

type TypeInfoSys

type TypeInfoSys interface {
	SupportByVal() bool
	SkipEmptyParams() bool
	IsWrapType(ctx llvm.Context, ftyp llvm.Type, typ llvm.Type, index int) bool
	GetTypeInfo(ctx llvm.Context, ftyp llvm.Type, typ llvm.Type, index int) *TypeInfo
}

type TypeInfoWasm

type TypeInfoWasm struct {
	*Transformer
}

func (*TypeInfoWasm) GetTypeInfo

func (p *TypeInfoWasm) GetTypeInfo(ctx llvm.Context, ftyp llvm.Type, typ llvm.Type, index int) *TypeInfo

func (*TypeInfoWasm) IsWrapType

func (p *TypeInfoWasm) IsWrapType(ctx llvm.Context, ftyp llvm.Type, typ llvm.Type, index int) bool

func (*TypeInfoWasm) SkipEmptyParams

func (p *TypeInfoWasm) SkipEmptyParams() bool

func (*TypeInfoWasm) SupportByVal

func (p *TypeInfoWasm) SupportByVal() bool

type TypeInfoWindows386 added in v1.0.1

type TypeInfoWindows386 struct {
	*Transformer
}

TypeInfoWindows386 implements the Microsoft x86 structure-return rules and the cdecl aggregate parameter rules emitted by Clang for the MSVC target.

func (*TypeInfoWindows386) GetTypeInfo added in v1.0.1

func (p *TypeInfoWindows386) GetTypeInfo(ctx llvm.Context, ftyp llvm.Type, typ llvm.Type, index int) *TypeInfo

func (*TypeInfoWindows386) IsWrapType added in v1.0.1

func (p *TypeInfoWindows386) IsWrapType(ctx llvm.Context, ftyp llvm.Type, typ llvm.Type, index int) bool

func (*TypeInfoWindows386) SkipEmptyParams added in v1.0.1

func (p *TypeInfoWindows386) SkipEmptyParams() bool

func (*TypeInfoWindows386) SupportByVal added in v1.0.1

func (p *TypeInfoWindows386) SupportByVal() bool

type TypeInfoWindowsAmd64 added in v1.0.1

type TypeInfoWindowsAmd64 struct {
	*Transformer
}

TypeInfoWindowsAmd64 implements the Microsoft x64 ABI aggregate rules. Unlike the SysV ABI, ordinary aggregates are never split across multiple registers. Aggregates of exactly 1, 2, 4, or 8 bytes use one integer register; all other non-empty aggregates are passed or returned indirectly.

func (*TypeInfoWindowsAmd64) GetTypeInfo added in v1.0.1

func (p *TypeInfoWindowsAmd64) GetTypeInfo(ctx llvm.Context, ftyp llvm.Type, typ llvm.Type, index int) *TypeInfo

func (*TypeInfoWindowsAmd64) IsWrapType added in v1.0.1

func (p *TypeInfoWindowsAmd64) IsWrapType(ctx llvm.Context, ftyp llvm.Type, typ llvm.Type, index int) bool

func (*TypeInfoWindowsAmd64) SkipEmptyParams added in v1.0.1

func (p *TypeInfoWindowsAmd64) SkipEmptyParams() bool

func (*TypeInfoWindowsAmd64) SupportByVal added in v1.0.1

func (p *TypeInfoWindowsAmd64) SupportByVal() bool

type TypeInfoWindowsArm64 added in v1.0.1

type TypeInfoWindowsArm64 struct {
	*TypeInfoArm64
}

Windows on ARM64 follows the AAPCS64 aggregate classification implemented by TypeInfoArm64. Keep a distinct selected type so OS-specific ABI changes cannot silently fall back to an architecture-only implementation.

func (*TypeInfoWindowsArm64) GetTypeInfo added in v1.0.1

func (p *TypeInfoWindowsArm64) GetTypeInfo(ctx llvm.Context, ftyp llvm.Type, typ llvm.Type, index int) *TypeInfo

func (*TypeInfoWindowsArm64) SkipEmptyParams added in v1.0.1

func (p *TypeInfoWindowsArm64) SkipEmptyParams() bool

Directories

Path Synopsis
_testdata
demo command

Jump to

Keyboard shortcuts

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