...

Package midway

import "cmd/compile/internal/midway"
Overview
Index

Overview ▾

Index ▾

func CheckPositions(files []*syntax.File, phase string)
func RewriteWrapper(pkg *types2.Package, info *types2.Info, files []*syntax.File) bool
type Analyzer
    func NewAnalyzer(pkg *types2.Package, info *types2.Info) *Analyzer
    func (a *Analyzer) Analyze(files []*syntax.File) bool
    func (a *Analyzer) HasDependentSignature(sig *types2.Signature) bool
type DeepCopier
    func NewDeepCopier(pkg *types2.Package, info *types2.Info, vecLen int, analyzer *Analyzer, suffix string) *DeepCopier
    func (c *DeepCopier) CopyBlockStmt(b *syntax.BlockStmt) *syntax.BlockStmt
    func (c *DeepCopier) CopyCaseClauses(list []*syntax.CaseClause) []*syntax.CaseClause
    func (c *DeepCopier) CopyCommClauses(list []*syntax.CommClause) []*syntax.CommClause
    func (c *DeepCopier) CopyConstDecl(d *syntax.ConstDecl) *syntax.ConstDecl
    func (c *DeepCopier) CopyDecl(d syntax.Decl) syntax.Decl
    func (c *DeepCopier) CopyExpr(e syntax.Expr) syntax.Expr
    func (c *DeepCopier) CopyField(f *syntax.Field) *syntax.Field
    func (c *DeepCopier) CopyFieldList(f []*syntax.Field) []*syntax.Field
    func (c *DeepCopier) CopyFuncDecl(d *syntax.FuncDecl) *syntax.FuncDecl
    func (c *DeepCopier) CopyName(id *syntax.Name, isDef bool) *syntax.Name
    func (c *DeepCopier) CopyNameExpr(id *syntax.Name) syntax.Expr
    func (c *DeepCopier) CopySimpleStmt(s syntax.SimpleStmt) syntax.SimpleStmt
    func (c *DeepCopier) CopyStmt(s syntax.Stmt) syntax.Stmt
    func (c *DeepCopier) CopyTypeDecl(d *syntax.TypeDecl) *syntax.TypeDecl
    func (c *DeepCopier) CopyVarDecl(d *syntax.VarDecl) *syntax.VarDecl
    func (c *DeepCopier) OnName(id *syntax.Name) *syntax.Name
    func (c *DeepCopier) OnNameExpr(id *syntax.Name) syntax.Expr
    func (c *DeepCopier) OnSelector(se *syntax.SelectorExpr) syntax.Expr
type Rewriter
    func NewRewriter(pkg *types2.Package, info *types2.Info, analyzer *Analyzer, sizes []int) *Rewriter
    func (r *Rewriter) Rewrite(files []*syntax.File)

Package files

analysis.go check.go deepcopy.go midway.go rewrite.go

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

type Analyzer

Analyzer holds the state for SIMD dependency analysis

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

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

DeepCopier clones syntax nodes and maintains types2.Info mappings.

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

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)