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 []int
var fakeLinesOnce sync.Once
const maxlines = *ast.BinaryExpr
See 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.Package
func (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.Interface
later 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.Func
newAliasTypeName 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.TypeName
func (pr *pkgReader) newReader(k pkgbits.RelocKind, idx pkgbits.Index, marker pkgbits.SyncMarker) *reader
func (r *reader) obj() (types.Object, []types.Type)
func (pr *pkgReader) objDictIdx(idx pkgbits.Index) *readerDict
func (pr *pkgReader) objIdx(idx pkgbits.Index) (*types.Package, string)
func (r *reader) param() *types.Var
func (r *reader) params() *types.Tuple
func (r *reader) pkg() *types.Package
func (pr *pkgReader) pkgIdx(idx pkgbits.Index) *types.Package
pkgScope 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.Scope
func (s *fakeFileSet) pos(file string, line int, column int) token.Pos
func (r *reader) pos() token.Pos
func (r *reader) posBase() string
func (pr *pkgReader) posBaseIdx(idx pkgbits.Index) string
func (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.Package
func (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.Signature
See cmd/compile/internal/types.SplitVargenSuffix.
func splitVargenSuffix(name string) (base string, suffix string)
func (r *reader) structType() *types.Struct
func (pr *pkgReader) tempReader(k pkgbits.RelocKind, idx pkgbits.Index, marker pkgbits.SyncMarker) *reader
func (r *reader) typ() types.Type
func (pr *pkgReader) typIdx(info typeInfo, dict *readerDict) types.Type
func (r *reader) typInfo() typeInfo
func (r *reader) typeParamNames() []*types.TypeParam
func (r *reader) unionType() *types.Union
Generated with Arrow