mirror of https://github.com/tinygo-org/tinygo.git
wasmstm32webassemblymicrocontrollerarmavrspiwasiadafruitarduinocircuitplayground-expressgpioi2cllvmmicrobitnrf51nrf52nrf52840samd21tinygo
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
443 B
18 lines
443 B
package loader
|
|
|
|
import (
|
|
"golang.org/x/tools/go/ssa"
|
|
)
|
|
|
|
// LoadSSA constructs the SSA form of the loaded packages.
|
|
//
|
|
// The program must already be parsed and type-checked with the .Parse() method.
|
|
func (p *Program) LoadSSA() *ssa.Program {
|
|
prog := ssa.NewProgram(p.fset, ssa.SanityCheckFunctions|ssa.BareInits|ssa.GlobalDebug)
|
|
|
|
for _, pkg := range p.Sorted() {
|
|
prog.CreatePackage(pkg.Pkg, pkg.Files, &pkg.Info, true)
|
|
}
|
|
|
|
return prog
|
|
}
|
|
|