From 8ccf558e8ad400746c297c66f6493427d382cfe4 Mon Sep 17 00:00:00 2001 From: Alan Donovan Date: Fri, 29 May 2015 12:33:10 -0400 Subject: [PATCH] cmd/callgraph: update flag docstring And add a TODO. Change-Id: I51c63b32e9ac4309cdfb8228348a5d528f36a919 Reviewed-on: https://go-review.googlesource.com/10489 Reviewed-by: Robert Griesemer --- cmd/callgraph/main.go | 2 +- go/callgraph/static/static.go | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/cmd/callgraph/main.go b/cmd/callgraph/main.go index 2aa9739a..29179dd8 100644 --- a/cmd/callgraph/main.go +++ b/cmd/callgraph/main.go @@ -42,7 +42,7 @@ import ( ) var algoFlag = flag.String("algo", "rta", - `Call graph construction algorithm, one of "rta" or "pta"`) + `Call graph construction algorithm (static, cha, rta, pta)`) var testFlag = flag.Bool("test", false, "Loads test code (*_test.go) for imported packages") diff --git a/go/callgraph/static/static.go b/go/callgraph/static/static.go index ebb183bd..709bb7b6 100644 --- a/go/callgraph/static/static.go +++ b/go/callgraph/static/static.go @@ -15,6 +15,8 @@ func CallGraph(prog *ssa.Program) *callgraph.Graph { cg := callgraph.New(nil) // TODO(adonovan) eliminate concept of rooted callgraph // TODO(adonovan): opt: use only a single pass over the ssa.Program. + // TODO(adonovan): opt: this is slower than RTA (perhaps because + // the lower precision means so many edges are allocated)! for f := range ssautil.AllFunctions(prog) { fnode := cg.CreateNode(f) for _, b := range f.Blocks {