Documentation
¶
Overview ¶
Package frontcache describes the frontend information needed from an already compiled dependency, independently of its instruction bodies.
Index ¶
- func FunctionID(fn *ssa.Function, typs *Types) string
- func ImportPackage(data *PackageExport, importer *TypeImporter) (*types.Package, error)
- func Owner(fn *ssa.Function) *types.Package
- func Position(fset *token.FileSet, pos token.Pos) string
- type Object
- type PackageExport
- type PackageObject
- type TypeGraph
- type TypeImporter
- type TypeNode
- type Types
- func (t *Types) Add(typ types.Type)
- func (t *Types) AddPackage(pkg *types.Package, info *types.Info)
- func (t *Types) Bind(key string, typ types.Type) bool
- func (t *Types) Key(typ types.Type) string
- func (t *Types) Lookup(key string) (types.Type, bool)
- func (t *Types) PackageID(pkg *types.Package) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ImportPackage ¶
func ImportPackage(data *PackageExport, importer *TypeImporter) (*types.Package, error)
ImportPackage populates an empty package using this invocation's dependency identities. Callers publish it only after the complete graph validates.
Types ¶
type Object ¶
type Object struct {
Name, Package, Position string
Type int
Embedded bool `json:",omitempty"`
Tag []byte `json:",omitempty"`
}
Object preserves package identity for private fields/methods as well as names. Type refers to a TypeGraph node; -1 is the only absent-type representation.
type PackageExport ¶
type PackageExport struct {
ID, Path, Name string
Types TypeGraph
Objects []PackageObject
}
func ExportPackage ¶
ExportPackage includes private declarations: code generation and layout metadata need more than the public API accepted by a source importer.
type PackageObject ¶
type TypeGraph ¶
type TypeGraph struct {
Nodes []TypeNode
// contains filtered or unexported fields
}
TypeGraph transports private and compiler-generated runtime types that are not necessarily reachable from gc's public export data. Cycles use node IDs; neither Go pointers nor LLVM-owned values cross a process boundary.
type TypeImporter ¶
type TypeNode ¶
type TypeNode struct {
Kind string
Key string
Object Object
Elem, Base int
Basic, Direction int
Length int64
Variadic bool
Implicit bool
Universe bool
Types, Params, Results []int `json:",omitempty"`
TypeParams, RecvParams []int `json:",omitempty"`
Receiver *Object `json:",omitempty"`
Parameters, Returns, Elements []Object `json:",omitempty"`
Fields, Methods []Object `json:",omitempty"`
Tilde []bool `json:",omitempty"`
}
type Types ¶
type Types struct {
// contains filtered or unexported fields
}
Types binds exported type identities to this invocation's checked types. Package IDs, rather than import paths, distinguish test and alternate packages. Ambiguous identities fail closed instead of selecting a type.
func (*Types) Add ¶
Add records all constituent types, including the receiver-free method-value signatures and pointer types that SSA may synthesize from declarations.
func (*Types) Bind ¶
Bind retains the exported identity of a private type imported without its original lexical scope. Package fingerprints validate its defining source.