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(pkg *types2.Package, info *types2.Info, files []*syntax.File) bool
Generate an API matching the standalone compilation call
Analyzer holds the state for SIMD dependency analysis
type Analyzer struct {
// contains filtered or unexported fields
}
func NewAnalyzer(pkg *types2.Package, info *types2.Info) *Analyzer
func (a *Analyzer) Analyze(files []*syntax.File) bool
Analyze builds the set of SIMD-dependent objects
func (a *Analyzer) HasDependentSignature(sig *types2.Signature) bool
DeepCopier clones syntax nodes and maintains types2.Info mappings.
type DeepCopier struct {
VecLen int
// contains filtered or unexported fields
}
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
OnName rewrites "dependent" and SIMD names to their architecture-specific version.
func (c *DeepCopier) OnNameExpr(id *syntax.Name) syntax.Expr
OnNameExpr rewrites references to simd.<simd type> into <bridge package>.<size-dependent-type>.
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 struct {
// contains filtered or unexported fields
}
func NewRewriter(pkg *types2.Package, info *types2.Info, analyzer *Analyzer, sizes []int) *Rewriter
func (r *Rewriter) Rewrite(files []*syntax.File)