noder

package standard library
go1.27rc1 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2026 License: BSD-3-Clause Imports: 50 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Addr

func Addr(pos src.XPos, x ir.Node) *ir.AddrExpr

func CloseHTMLWriters

func CloseHTMLWriters()

CloseHTMLWriters closes the HTML writer for fn, if one exists.

func Deref

func Deref(pos src.XPos, typ *types.Type, x ir.Node) *ir.StarExpr

func DumpNodeHTML

func DumpNodeHTML(pkg *types2.Package, file *syntax.File, info *types2.Info, fn *syntax.FuncDecl, why string, n syntax.Node)

DumpNodeHTML dumps the node n to the HTML writer for fn.

func FixValue added in go1.18

func FixValue(typ *types.Type, val constant.Value) constant.Value

FixValue returns val after converting and truncating it as appropriate for typ.

func LoadPackage

func LoadPackage(filenames []string)

func LookupFunc added in go1.22.0

func LookupFunc(fullName string) (*ir.Func, error)

LookupFunc returns the ir.Func for an arbitrary full symbol name if that function exists in the set of available export data.

This allows lookup of arbitrary functions and methods that aren't otherwise referenced by the local package and thus haven't been read yet.

TODO(prattmic): Does not handle instantiation of generic types. Currently profiles don't contain the original type arguments, so we won't be able to create the runtime dictionaries.

TODO(prattmic): Hit rate of this function is usually fairly low, and errors are only used when debug logging is enabled. Consider constructing cheaper errors by default.

func MakeWrappers added in go1.18

func MakeWrappers(target *ir.Package)

MakeWrappers constructs all wrapper methods needed for the target compilation unit.

func MatchASTDump

func MatchASTDump(fn *syntax.FuncDecl) bool

MatchASTDump returns true if the fn matches the value of the astdump debug flag.

func PostLookupCleanup added in go1.23.0

func PostLookupCleanup()

PostLookupCleanup performs cleanup operations needed after a series of calls to LookupFunc, specifically invoking readBodies to post-process any funcs on the "todoBodies" list that were added as a result of the lookup operations.

func Renameinit added in go1.19

func Renameinit() *types.Sym

func Shapify

func Shapify(targ *types.Type, basic bool) *types.Type

Shapify returns the shape type for targ.

If basic is true, then the type argument is used to instantiate a type parameter whose constraint is a basic interface.

func WriteExports added in go1.18

func WriteExports(out *bio.Writer)

Types

type HTMLWriter

type HTMLWriter struct {
	ir.HTMLWriterBase

	Decl *syntax.FuncDecl
	// contains filtered or unexported fields
}

An HTMLWriter dumps syntax nodes to multicolumn HTML, similar to what the ssa backend does for GOSSAFUNC.

func NewHTMLWriter

func NewHTMLWriter(pkg *types2.Package, file *syntax.File, info *types2.Info, path string, decl *syntax.FuncDecl, cfgMask string) *HTMLWriter

func (*HTMLWriter) DeclHTML

func (w *HTMLWriter) DeclHTML(phase string) func()

type ImplicitNode

type ImplicitNode interface {
	ir.Node
	SetImplicit(x bool)
}

func Implicit

func Implicit(n ImplicitNode) ImplicitNode

Implicit returns n after marking it as Implicit.

type WasmExport added in go1.24.0

type WasmExport struct {
	Pos  syntax.Pos
	Name string
}

WasmExport stores metadata associated with the //go:wasmexport pragma

type WasmImport added in go1.21.0

type WasmImport struct {
	Pos    syntax.Pos
	Module string
	Name   string
}

WasmImport stores metadata associated with the //go:wasmimport pragma

Jump to

Keyboard shortcuts

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