midway

package standard library
go1.27.0 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2026 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckPositions

func CheckPositions(files []*syntax.File, phase string)

CheckPositions checks that all nodes in the files have known positions. This converts lack-of-Pos into an early fatal error instead of a later weird downstream error (e.g., in the linker, in debugging information).

func RewriteWrapper

func RewriteWrapper(pkg *types2.Package, info *types2.Info, files []*syntax.File) bool

Generate an API matching the standalone compilation call

Types

type Analyzer

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

Analyzer holds the state for SIMD dependency analysis

func NewAnalyzer

func NewAnalyzer(pkg *types2.Package, info *types2.Info) *Analyzer

func (*Analyzer) Analyze

func (a *Analyzer) Analyze(files []*syntax.File) bool

Analyze builds the set of SIMD-dependent objects

func (*Analyzer) HasDependentSignature

func (a *Analyzer) HasDependentSignature(sig *types2.Signature) bool

type DeepCopier

type DeepCopier struct {
	VecLen int
	// contains filtered or unexported fields
}

DeepCopier clones syntax nodes and maintains types2.Info mappings.

func NewDeepCopier

func NewDeepCopier(pkg *types2.Package, info *types2.Info, vecLen int, analyzer *Analyzer, suffix string) *DeepCopier

func (*DeepCopier) CopyBlockStmt

func (c *DeepCopier) CopyBlockStmt(b *syntax.BlockStmt) *syntax.BlockStmt

func (*DeepCopier) CopyCaseClauses

func (c *DeepCopier) CopyCaseClauses(list []*syntax.CaseClause) []*syntax.CaseClause

func (*DeepCopier) CopyCommClauses

func (c *DeepCopier) CopyCommClauses(list []*syntax.CommClause) []*syntax.CommClause

func (*DeepCopier) CopyConstDecl

func (c *DeepCopier) CopyConstDecl(d *syntax.ConstDecl) *syntax.ConstDecl

func (*DeepCopier) CopyDecl

func (c *DeepCopier) CopyDecl(d syntax.Decl) syntax.Decl

func (*DeepCopier) CopyExpr

func (c *DeepCopier) CopyExpr(e syntax.Expr) syntax.Expr

func (*DeepCopier) CopyField

func (c *DeepCopier) CopyField(f *syntax.Field) *syntax.Field

func (*DeepCopier) CopyFieldList

func (c *DeepCopier) CopyFieldList(f []*syntax.Field) []*syntax.Field

func (*DeepCopier) CopyFuncDecl

func (c *DeepCopier) CopyFuncDecl(d *syntax.FuncDecl) *syntax.FuncDecl

func (*DeepCopier) CopyName

func (c *DeepCopier) CopyName(id *syntax.Name, isDef bool) *syntax.Name

func (*DeepCopier) CopyNameExpr

func (c *DeepCopier) CopyNameExpr(id *syntax.Name) syntax.Expr

func (*DeepCopier) CopySimpleStmt

func (c *DeepCopier) CopySimpleStmt(s syntax.SimpleStmt) syntax.SimpleStmt

func (*DeepCopier) CopyStmt

func (c *DeepCopier) CopyStmt(s syntax.Stmt) syntax.Stmt

func (*DeepCopier) CopyTypeDecl

func (c *DeepCopier) CopyTypeDecl(d *syntax.TypeDecl) *syntax.TypeDecl

func (*DeepCopier) CopyVarDecl

func (c *DeepCopier) CopyVarDecl(d *syntax.VarDecl) *syntax.VarDecl

func (*DeepCopier) OnName

func (c *DeepCopier) OnName(id *syntax.Name) *syntax.Name

OnName rewrites "dependent" and SIMD names to their architecture-specific version.

func (*DeepCopier) OnNameExpr

func (c *DeepCopier) OnNameExpr(id *syntax.Name) syntax.Expr

OnNameExpr rewrites references to simd.<simd type> into <bridge package>.<size-dependent-type>.

func (*DeepCopier) OnSelector

func (c *DeepCopier) OnSelector(se *syntax.SelectorExpr) syntax.Expr

OnSelector is looking for simd.Something, to be rewritten into appropriately. Note that this will not work properly within the simd package because there is no "simd." selection there.

type Rewriter

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

func NewRewriter

func NewRewriter(pkg *types2.Package, info *types2.Info, analyzer *Analyzer, sizes []int) *Rewriter

func (*Rewriter) Rewrite

func (r *Rewriter) Rewrite(files []*syntax.File)

Jump to

Keyboard shortcuts

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