compiler_extra

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeclareFileStub

func DeclareFileStub(fileIndex int, absFile string) string

func DeclareFileStubForVar

func DeclareFileStubForVar(fileIndex int, absFile string) string

func DeclareFileStubGc

func DeclareFileStubGc(fileIndex int, absFile string) string

func DeclareInitFunc

func DeclareInitFunc(names PkgNames) string

make IR not inline check patch/link/link_ir.go

func DeclarePkgStubs

func DeclarePkgStubs(pkgPath string, names PkgNames) []string

func GenerateRegCode

func GenerateRegCode(__xgo_init string, varDefs []string, varRegs []string, delayInits []string) string

func JoinQuoteNames

func JoinQuoteNames(names []string, sep string) string

func JoinStmts

func JoinStmts(stmts ...string) string

func QuoteNames

func QuoteNames(names []string) []string

Types

type Field

type Field struct {
	Name string
}

type Fields

type Fields []*Field

func (*Fields) Names

func (c *Fields) Names() []string

type File

type File struct {
	Name       string       `json:"name,omitempty"`
	AbsFile    string       `json:"absFile,omitempty"`
	Funcs      []*Func      `json:"funcs,omitempty"`
	Interfaces []*Interface `json:"interfaces,omitempty"`
}

func (*File) BuildMapping

func (c *File) BuildMapping() *FileMapping

type FileDecls

type FileDecls struct {
	TrapFuncs      []FuncInfo
	TrapVars       []VarInfo
	InterfaceTypes []InterfaceType
}

type FileMapping

type FileMapping struct {
	Funcs      map[string]*FuncMapping      `json:"funcs,omitempty"`
	Interfaces map[string]*InterfaceMapping `json:"interfaces,omitempty"`
}

type Func

type Func struct {
	IdentityName string `json:"identityName,omitempty"`
}

type FuncInfo

type FuncInfo struct {
	IdentityName     string
	Name             string
	HasGenericParams bool
	LineNum          int
	InfoVar          string

	RecvPtr      bool
	RecvGeneric  bool
	RecvTypeName string

	Receiver *Field
	Params   Fields
	Results  Fields
}

type FuncMapping

type FuncMapping struct{}

type Interface

type Interface struct {
	Name string `json:"name,omitempty"`
}

type InterfaceMapping

type InterfaceMapping struct{}

type InterfaceType

type InterfaceType struct {
	Name    string
	LineNum int
	InfoVar string
}

type Literal

type Literal struct {
	VarDefs    string
	VarRegs    string
	DelayInits string
}

func DefineFuncLiteral

func DefineFuncLiteral(funcInfo *FuncInfo, stdlib bool, fileVar string, names PkgNames) Literal

func DefineIntfTypeLiteral

func DefineIntfTypeLiteral(intfType *InterfaceType, stdlib bool, fileVar string, names PkgNames) Literal

func DefineVarLiteral

func DefineVarLiteral(varInfo *VarInfo, stdlib bool, FILE_VAR string, names PkgNames) Literal

type Package

type Package struct {
	Path       string  `json:"path,omitempty"`
	HasVarTrap bool    `json:"hasVarTrap,omitempty"`
	Files      []*File `json:"files,omitempty"`
	TrapMD5Sum string  `json:"trapMD5Sum,omitempty"`
}

type PackageMapping

type PackageMapping struct {
	HasVarTrap bool                    `json:"hasVarTrap,omitempty"`
	Files      map[string]*FileMapping `json:"files,omitempty"`
}

type Packages

type Packages struct {
	Packages []*Package `json:"packages,omitempty"`
}

func (*Packages) BuildLookup

func (c *Packages) BuildLookup() map[string]*Package

func (*Packages) BuildMD5SumMapping

func (c *Packages) BuildMD5SumMapping() map[string]string

func (*Packages) BuildMapping

func (c *Packages) BuildMapping() *PackagesMapping

type PackagesMapping

type PackagesMapping struct {
	Packages map[string]*PackageMapping `json:"packages,omitempty"`
}

mapping for efficient reading for large project, the mapping file can be as large as 6MB, be careful with the file size

func ParseMapping

func ParseMapping(file string) (*PackagesMapping, error)

type PkgNames

type PkgNames struct {
	REGISTER     string
	TRAP_FUNC    string
	TRAP_VAR     string
	TRAP_VAR_PTR string

	FUNC_INFO_TYPE string
	PKG_VAR        string

	XGO_INIT string
}

type Result

type Result struct {
	VarDefStmts    []string
	VarRegStmts    []string
	DelayInitStmts []string
}

func GetFileRegStmts

func GetFileRegStmts(file *FileDecls, stdlib bool, fileVar string, fileVarForVar string, names PkgNames) Result

type VarInfo

type VarInfo struct {
	Name    string
	LineNum int
	InfoVar string
}

Jump to

Keyboard shortcuts

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