Skip to content

Commit

Permalink
Improve call graph
Browse files Browse the repository at this point in the history
  • Loading branch information
chriso committed Sep 22, 2023
1 parent 32a5667 commit 6357e79
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions compiler/compile.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (

"golang.org/x/tools/go/ast/astutil"
"golang.org/x/tools/go/callgraph/cha"
"golang.org/x/tools/go/callgraph/vta"
"golang.org/x/tools/go/packages"
"golang.org/x/tools/go/ssa"
"golang.org/x/tools/go/ssa/ssautil"
Expand Down Expand Up @@ -117,11 +118,11 @@ func (c *compiler) compile(path string) error {
}

log.Printf("building SSA program")
prog, _ := ssautil.Packages(pkgs, ssa.InstantiateGenerics|ssa.GlobalDebug)
prog, _ := ssautil.AllPackages(pkgs, ssa.InstantiateGenerics|ssa.GlobalDebug)
prog.Build()

log.Printf("building call graph")
cg := cha.CallGraph(prog)
cg := vta.CallGraph(ssautil.AllFunctions(prog), cha.CallGraph(prog))

log.Printf("finding generic yield instantiations")
var coroutinePkg *packages.Package
Expand Down

0 comments on commit 6357e79

Please sign in to comment.