Imports #
"go/token"
"go/types"
"internal/godebug"
"internal/pkgbits"
"slices"
"strings"
"bufio"
"fmt"
"go/token"
"go/types"
"internal/exportdata"
"internal/pkgbits"
"io"
"os"
"fmt"
"go/token"
"internal/pkgbits"
"sync"
"go/token"
"go/types"
"internal/godebug"
"internal/pkgbits"
"slices"
"strings"
"bufio"
"fmt"
"go/token"
"go/types"
"internal/exportdata"
"internal/pkgbits"
"io"
"os"
"fmt"
"go/token"
"internal/pkgbits"
"sync"
var fakeLines []intvar fakeLinesOnce sync.Onceconst maxlines = *ast.BinaryExprSee cmd/compile/internal/noder.derivedInfo.
type derivedInfo struct {
idx pkgbits.Index
needed bool
}Synthesize a token.Pos
type fakeFileSet struct {
fset *token.FileSet
files map[string]*fileInfo
}type fileInfo struct {
file *token.File
lastline int
}A pkgReader holds the shared state for reading a unified IR package description.
type pkgReader struct {
pkgbits.PkgDecoder
fake fakeFileSet
ctxt *types.Context
imports map[string]*types.Package
posBases []string
pkgs []*types.Package
typs []types.Type
laterFns []func()
ifaces []*types.Interface
}A reader holds the state for reading a single unified IR element within a package.
type reader struct {
pkgbits.Decoder
p *pkgReader
dict *readerDict
}A readerDict holds the state for type parameters that parameterize the current unified IR element.
type readerDict struct {
bounds []typeInfo
tparams []*types.TypeParam
derived []derivedInfo
derivedTypes []types.Type
}See cmd/compile/internal/noder.typeInfo.
type typeInfo struct {
idx pkgbits.Index
derived bool
}Import imports a gc-generated package given its import path and srcDir, adds the corresponding package object to the packages map, and returns the object. The packages map must contain all packages already imported.
func Import(fset *token.FileSet, packages map[string]*types.Package, path string, srcDir string, lookup func(path string) (io.ReadCloser, error)) (pkg *types.Package, err error)func assert(b bool)func (r *reader) doPkg() *types.Packagefunc (r *reader) doTyp() (res types.Type)func errorf(format string, args ...any)func (r *reader) ident(marker pkgbits.SyncMarker) (*types.Package, string)func (r *reader) interfaceType() *types.Interfacelater adds a function to be invoked at the end of import reading.
func (pr *pkgReader) later(fn func())func (r *reader) localIdent() (*types.Package, string)func (r *reader) method() *types.FuncnewAliasTypeName returns a new TypeName, with a materialized *types.Alias if supported.
func newAliasTypeName(pos token.Pos, pkg *types.Package, name string, rhs types.Type, tparams []*types.TypeParam) *types.TypeNamefunc (pr *pkgReader) newReader(k pkgbits.RelocKind, idx pkgbits.Index, marker pkgbits.SyncMarker) *readerfunc (r *reader) obj() (types.Object, []types.Type)func (pr *pkgReader) objDictIdx(idx pkgbits.Index) *readerDictfunc (pr *pkgReader) objIdx(idx pkgbits.Index) (*types.Package, string)func (r *reader) param() *types.Varfunc (r *reader) params() *types.Tuplefunc (r *reader) pkg() *types.Packagefunc (pr *pkgReader) pkgIdx(idx pkgbits.Index) *types.PackagepkgScope returns pkg.Scope(). If pkg is nil, it returns types.Universe instead. TODO(mdempsky): Remove after x/tools can depend on Go 1.19.
func pkgScope(pkg *types.Package) *types.Scopefunc (s *fakeFileSet) pos(file string, line int, column int) token.Posfunc (r *reader) pos() token.Posfunc (r *reader) posBase() stringfunc (pr *pkgReader) posBaseIdx(idx pkgbits.Index) stringfunc (r *reader) qualifiedIdent() (*types.Package, string)readUnifiedPackage reads a package description from the given unified IR export data decoder.
func readUnifiedPackage(fset *token.FileSet, ctxt *types.Context, imports map[string]*types.Package, input pkgbits.PkgDecoder) *types.Packagefunc (pr *pkgReader) retireReader(r *reader)func (r *reader) selector() (*types.Package, string)func (s *fakeFileSet) setLines()func (r *reader) signature(recv *types.Var, rtparams []*types.TypeParam, tparams []*types.TypeParam) *types.SignatureSee cmd/compile/internal/types.SplitVargenSuffix.
func splitVargenSuffix(name string) (base string, suffix string)func (r *reader) structType() *types.Structfunc (pr *pkgReader) tempReader(k pkgbits.RelocKind, idx pkgbits.Index, marker pkgbits.SyncMarker) *readerfunc (r *reader) typ() types.Typefunc (pr *pkgReader) typIdx(info typeInfo, dict *readerDict) types.Typefunc (r *reader) typInfo() typeInfofunc (r *reader) typeParamNames() []*types.TypeParamfunc (r *reader) unionType() *types.UnionGenerated with Arrow