go/src/cmd/compile/internal/noder/writer.go

type index

func assert(p bool) {}

type pkgWriter

// newPkgWriter returns an initialized pkgWriter for the specified
// package.
func newPkgWriter(m posMap, pkg *types2.Package, info *types2.Info, otherInfo map[*syntax.FuncLit]bool) *pkgWriter {}

// errorf reports a user error about thing p.
func (pw *pkgWriter) errorf(p poser, msg string, args ...interface{}

// fatalf reports an internal compiler error about thing p.
func (pw *pkgWriter) fatalf(p poser, msg string, args ...interface{}

// unexpected reports a fatal error about a thing of unexpected
// dynamic type.
func (pw *pkgWriter) unexpected(what string, p poser) {}

func (pw *pkgWriter) typeAndValue(x syntax.Expr) syntax.TypeAndValue {}

func (pw *pkgWriter) maybeTypeAndValue(x syntax.Expr) (syntax.TypeAndValue, bool) {}

// typeOf returns the Type of the given value expression.
func (pw *pkgWriter) typeOf(expr syntax.Expr) types2.Type {}

type writer

type writerDict

type itabInfo

// typeParamIndex returns the index of the given type parameter within
// the dictionary. This may differ from typ.Index() when there are
// implicit type parameters due to defined types declared within a
// generic function or method.
func (dict *writerDict) typeParamIndex(typ *types2.TypeParam) int {}

type derivedInfo

type typeInfo

type objInfo

type selectorInfo

// anyDerived reports whether any of info's explicit type arguments
// are derived types.
func (info objInfo) anyDerived() bool {}

// equals reports whether info and other represent the same Go object
// (i.e., same base object and identical type arguments, if any).
func (info objInfo) equals(other objInfo) bool {}

type writerMethodExprInfo

// typeParamMethodExprIdx returns the index where the given encoded
// method expression function pointer appears within this dictionary's
// type parameters method expressions section, adding it if necessary.
func (dict *writerDict) typeParamMethodExprIdx(typeParamIdx int, methodInfo selectorInfo) int {}

// subdictIdx returns the index where the given encoded object's
// runtime dictionary appears within this dictionary's subdictionary
// section, adding it if necessary.
func (dict *writerDict) subdictIdx(newInfo objInfo) int {}

// rtypeIdx returns the index where the given encoded type's
// *runtime._type value appears within this dictionary's rtypes
// section, adding it if necessary.
func (dict *writerDict) rtypeIdx(newInfo typeInfo) int {}

// itabIdx returns the index where the given encoded type pair's
// *runtime.itab value appears within this dictionary's itabs section,
// adding it if necessary.
func (dict *writerDict) itabIdx(typInfo, ifaceInfo typeInfo) int {}

func (pw *pkgWriter) newWriter(k pkgbits.RelocKind, marker pkgbits.SyncMarker) *writer {}

// pos writes the position of p into the element bitstream.
func (w *writer) pos(p poser) {}

// posBase writes a reference to the given PosBase into the element
// bitstream.
func (w *writer) posBase(b *syntax.PosBase) {}

// posBaseIdx returns the index for the given PosBase.
func (pw *pkgWriter) posBaseIdx(b *syntax.PosBase) index {}

// pkg writes a use of the given Package into the element bitstream.
func (w *writer) pkg(pkg *types2.Package) {}

func (w *writer) pkgRef(idx index) {}

// pkgIdx returns the index for the given package, adding it to the
// package export data if needed.
func (pw *pkgWriter) pkgIdx(pkg *types2.Package) index {}

var anyTypeName

var comparableTypeName

var runeTypeName

// typ writes a use of the given type into the bitstream.
func (w *writer) typ(typ types2.Type) {}

// typInfo writes a use of the given type (specified as a typeInfo
// instead) into the bitstream.
func (w *writer) typInfo(info typeInfo) {}

// typIdx returns the index where the export data description of type
// can be read back in. If no such index exists yet, it's created.
//
// typIdx also reports whether typ is a derived type; that is, whether
// its identity depends on type parameters.
func (pw *pkgWriter) typIdx(typ types2.Type, dict *writerDict) typeInfo {}

// namedType writes a use of the given named type into the bitstream.
func (w *writer) namedType(obj *types2.TypeName, targs *types2.TypeList) {}

func (w *writer) structType(typ *types2.Struct) {}

func (w *writer) unionType(typ *types2.Union) {}

func (w *writer) interfaceType(typ *types2.Interface) {}

func (w *writer) signature(sig *types2.Signature) {}

func (w *writer) params(typ *types2.Tuple) {}

func (w *writer) param(param *types2.Var) {}

// obj writes a use of the given object into the bitstream.
//
// If obj is a generic object, then explicits are the explicit type
// arguments used to instantiate it (i.e., used to substitute the
// object's own declared type parameters).
func (w *writer) obj(obj types2.Object, explicits *types2.TypeList) {}

// objInfo writes a use of the given encoded object into the
// bitstream.
func (w *writer) objInfo(info objInfo) {}

// objInstIdx returns the indices for an object and a corresponding
// list of type arguments used to instantiate it, adding them to the
// export data as needed.
func (pw *pkgWriter) objInstIdx(obj types2.Object, explicits *types2.TypeList, dict *writerDict) objInfo {}

// objIdx returns the index for the given Object, adding it to the
// export data as needed.
func (pw *pkgWriter) objIdx(obj types2.Object) index {}

// doObj writes the RelocObj definition for obj to w, and the
// RelocObjExt definition to wext.
func (w *writer) doObj(wext *writer, obj types2.Object) pkgbits.CodeObj {}

// objDict writes the dictionary needed for reading the given object.
func (w *writer) objDict(obj types2.Object, dict *writerDict) {}

func (w *writer) typeParamNames(tparams *types2.TypeParamList) {}

func (w *writer) method(wext *writer, meth *types2.Func) {}

// qualifiedIdent writes out the name of an object declared at package
// scope. (For now, it's also used to refer to local defined types.)
func (w *writer) qualifiedIdent(obj types2.Object) {}

// localIdent writes the name of a locally declared object (i.e.,
// objects that can only be accessed by non-qualified name, within the
// context of a particular function).
func (w *writer) localIdent(obj types2.Object) {}

// selector writes the name of a field or method (i.e., objects that
// can only be accessed using selector expressions).
func (w *writer) selector(obj types2.Object) {}

func (w *writer) selectorInfo(info selectorInfo) {}

func (pw *pkgWriter) selectorIdx(obj types2.Object) selectorInfo {}

func (w *writer) funcExt(obj *types2.Func) {}

func (w *writer) typeExt(obj *types2.TypeName) {}

func (w *writer) varExt(obj *types2.Var) {}

func (w *writer) linkname(obj types2.Object) {}

func (w *writer) pragmaFlag(p ir.PragmaFlag) {}

// bodyIdx returns the index for the given function body (specified by
// block), adding it to the export data
func (pw *pkgWriter) bodyIdx(sig *types2.Signature, block *syntax.BlockStmt, dict *writerDict) (idx index, closureVars []posVar) {}

func (w *writer) declareParams(sig *types2.Signature) {}

// addLocal records the declaration of a new local variable.
func (w *writer) addLocal(obj *types2.Var) {}

// useLocal writes a reference to the given local or free variable
// into the bitstream.
func (w *writer) useLocal(pos syntax.Pos, obj *types2.Var) {}

func (w *writer) openScope(pos syntax.Pos) {}

func (w *writer) closeScope(pos syntax.Pos) {}

func (w *writer) closeAnotherScope() {}

// stmt writes the given statement into the function body bitstream.
func (w *writer) stmt(stmt syntax.Stmt) {}

func (w *writer) stmts(stmts []syntax.Stmt) {}

func (w *writer) stmt1(stmt syntax.Stmt) {}

func (w *writer) assignList(expr syntax.Expr) {}

func (w *writer) assign(expr syntax.Expr) {}

func (w *writer) declStmt(decl syntax.Decl) {}

// assignStmt writes out an assignment for "lhs = rhs".
func (w *writer) assignStmt(pos poser, lhs0, rhs0 syntax.Expr) {}

func (w *writer) blockStmt(stmt *syntax.BlockStmt) {}

func (w *writer) forStmt(stmt *syntax.ForStmt) {}

func (w *writer) distinctVars(stmt *syntax.ForStmt) bool {}

func (w *writer) ifStmt(stmt *syntax.IfStmt) {}

func (w *writer) selectStmt(stmt *syntax.SelectStmt) {}

func (w *writer) switchStmt(stmt *syntax.SwitchStmt) {}

func (w *writer) label(label *syntax.Name) {}

func (w *writer) optLabel(label *syntax.Name) {}

// expr writes the given expression into the function body bitstream.
func (w *writer) expr(expr syntax.Expr) {}

func sliceElem(typ types2.Type) types2.Type {}

func (w *writer) optExpr(expr syntax.Expr) {}

// recvExpr writes out expr.X, but handles any implicit addressing,
// dereferencing, and field selections appropriate for the method
// selection.
func (w *writer) recvExpr(expr *syntax.SelectorExpr, sel *types2.Selection) types2.Type {}

// funcInst writes a reference to an instantiated function.
func (w *writer) funcInst(obj *types2.Func, targs *types2.TypeList) {}

// methodExpr writes out a reference to the method selected by
// expr. sel should be the corresponding types2.Selection, and recv
// the type produced after any implicit addressing, dereferencing, and
// field selection. (Note: recv might differ from sel.Obj()'s receiver
// parameter in the case of interface types, and is needed for
// handling type parameter methods.)
func (w *writer) methodExpr(expr *syntax.SelectorExpr, recv types2.Type, sel *types2.Selection) {}

// multiExpr writes a sequence of expressions, where the i'th value is
// implicitly converted to dstType(i). It also handles when exprs is a
// single, multi-valued expression (e.g., the multi-valued argument in
// an f(g()) call, or the RHS operand in a comma-ok assignment).
func (w *writer) multiExpr(pos poser, dstType func(int) types2.Type, exprs []syntax.Expr) {}

// implicitConvExpr is like expr, but if dst is non-nil and different
// from expr's type, then an implicit conversion operation is inserted
// at expr's position.
func (w *writer) implicitConvExpr(dst types2.Type, expr syntax.Expr) {}

func (w *writer) convertExpr(dst types2.Type, expr syntax.Expr, implicit bool) {}

func (w *writer) compLit(lit *syntax.CompositeLit) {}

func (w *writer) funcLit(expr *syntax.FuncLit) {}

type posVar

func (p posVar) String() string {}

func (w *writer) exprList(expr syntax.Expr) {}

func (w *writer) exprs(exprs []syntax.Expr) {}

// rtype writes information so that the reader can construct an
// expression of type *runtime._type representing typ.
func (w *writer) rtype(typ types2.Type) {}

func (w *writer) rtypeInfo(info typeInfo) {}

// varDictIndex writes out information for populating DictIndex for
// the ir.Name that will represent obj.
func (w *writer) varDictIndex(obj *types2.Var) {}

// isUntyped reports whether typ is an untyped type.
func isUntyped(typ types2.Type) bool {}

// isTuple reports whether typ is a tuple type.
func isTuple(typ types2.Type) bool {}

func (w *writer) itab(typ, iface types2.Type) {}

// convRTTI writes information so that the reader can construct
// expressions for converting from src to dst.
func (w *writer) convRTTI(src, dst types2.Type) {}

func (w *writer) exprType(iface types2.Type, typ syntax.Expr) {}

// isInterface reports whether typ is known to be an interface type.
// If typ is a type parameter, then isInterface reports an internal
// compiler error instead.
func isInterface(typ types2.Type) bool {}

// op writes an Op into the bitstream.
func (w *writer) op(op ir.Op) {}

type typeDeclGen

type fileImports

type declCollector

func (c *declCollector) withTParams(obj types2.Object) *declCollector {}

func (c *declCollector) Visit(n syntax.Node) syntax.Visitor {}

func (pw *pkgWriter) collectDecls(noders []*noder) {}

func (pw *pkgWriter) checkPragmas(p syntax.Pragma, allowed ir.PragmaFlag, embedOK bool) {}

func (w *writer) pkgInit(noders []*noder) {}

func (w *writer) pkgInitOrder() {}

func (w *writer) pkgDecl(decl syntax.Decl) {}

func (w *writer) pkgObjs(names ...*syntax.Name) {}

// staticBool analyzes a boolean expression and reports whether it's
// always true (positive result), always false (negative result), or
// unknown (zero).
//
// It also simplifies the expression while preserving semantics, if
// possible.
func (pw *pkgWriter) staticBool(ep *syntax.Expr) int {}

// hasImplicitTypeParams reports whether obj is a defined type with
// implicit type parameters (e.g., declared within a generic function
// or method).
func (pw *pkgWriter) hasImplicitTypeParams(obj *types2.TypeName) bool {}

// isDefinedType reports whether obj is a defined type.
func isDefinedType(obj types2.Object) bool {}

// isGlobal reports whether obj was declared at package scope.
//
// Caveat: blank objects are not declared.
func isGlobal(obj types2.Object) bool {}

// lookupObj returns the object that expr refers to, if any. If expr
// is an explicit instantiation of a generic object, then the instance
// object is returned as well.
func lookupObj(p *pkgWriter, expr syntax.Expr) (obj types2.Object, inst types2.Instance) {}

// isPkgQual reports whether the given selector expression is a
// package-qualified identifier.
func isPkgQual(info *types2.Info, sel *syntax.SelectorExpr) bool {}

// isNil reports whether expr is a (possibly parenthesized) reference
// to the predeclared nil value.
func isNil(p *pkgWriter, expr syntax.Expr) bool {}

// isBuiltin reports whether expr is a (possibly parenthesized)
// referenced to the specified built-in function.
func (pw *pkgWriter) isBuiltin(expr syntax.Expr, builtin string) bool {}

// recvBase returns the base type for the given receiver parameter.
func recvBase(recv *types2.Var) *types2.Named {}

// namesAsExpr returns a list of names as a syntax.Expr.
func namesAsExpr(names []*syntax.Name) syntax.Expr {}

// fieldIndex returns the index of the struct field named by key.
func fieldIndex(info *types2.Info, str *types2.Struct, key *syntax.Name) int {}

// objTypeParams returns the type parameters on the given object.
func objTypeParams(obj types2.Object) *types2.TypeParamList {}

// splitNamed decomposes a use of a defined type into its original
// type definition and the type arguments used to instantiate it.
func splitNamed(typ *types2.Named) (*types2.TypeName, *types2.TypeList) {}

// splitAlias is like splitNamed, but for an alias type.
func splitAlias(typ *types2.Alias) (*types2.TypeName, *types2.TypeList) {}

func asPragmaFlag(p syntax.Pragma) ir.PragmaFlag {}

func asWasmImport(p syntax.Pragma) *WasmImport {}

func asWasmExport(p syntax.Pragma) *WasmExport {}

// isPtrTo reports whether from is the type *to.
func isPtrTo(from, to types2.Type) bool {}

// hasFallthrough reports whether stmts ends in a fallthrough
// statement.
func hasFallthrough(stmts []syntax.Stmt) bool {}

// lastNonEmptyStmt returns the last non-empty statement in list, if
// any.
func lastNonEmptyStmt(stmts []syntax.Stmt) syntax.Stmt {}

// terminates reports whether stmt terminates normal control flow
// (i.e., does not merely advance to the following statement).
func (pw *pkgWriter) terminates(stmt syntax.Stmt) bool {}