MCPcopy Create free account
hub / github.com/despiteallobjections/amigo / NewProgram

Function NewProgram

types/create.go:22–36  ·  view source on GitHub ↗

NewProgram returns a new SSA Program. mode controls diagnostics and checking during SSA construction.

(mode BuilderMode)

Source from the content-addressed store, hash-verified

20// mode controls diagnostics and checking during SSA construction.
21//
22func NewProgram(mode BuilderMode) *Program {
23 prog := &Program{
24 imported: make(map[string]*SSAPackage),
25 packages: make(map[*Package]*SSAPackage),
26 thunks: make(map[selectionKey]*Function),
27 bounds: make(map[*Func]*Function),
28 mode: mode,
29 }
30
31 h := MakeHasher() // protected by methodsMu, in effect
32 prog.methodSets.SetHasher(h)
33 prog.canon.SetHasher(h)
34
35 return prog
36}
37
38// memberFromObject populates package pkg with a member for the
39// typechecker object obj.

Callers 3

doPackagesFunction · 0.92
CreateProgramFunction · 0.92
BuildPackageFunction · 0.92

Calls 2

MakeHasherFunction · 0.85
SetHasherMethod · 0.80

Tested by

no test coverage detected