Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(435)

Issue 176780043: code review 176780043: cmd/callgraph: add -algo=static and -algo=cha options. (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years, 8 months ago by adonovan
Modified:
10 years, 8 months ago
Reviewers:
Sameer Ajmani
CC:
Sameer Ajmani, minux, golang-codereviews, gri
Visibility:
Public.

Description

cmd/callgraph: add -algo=static and -algo=cha options. "static" ignores dynamic calls altogether. "cha" uses Class Hierarchy Analysis, which assumes that a dynamic call may dispatch to any func or method that satisfies the type. Both these algorithms can work on partial programs, e.g. libraries without a main function or tests. (This feature was requested after my talk last night.) + Tests.

Patch Set 1 #

Patch Set 2 : diff -r 7a206220eb24ca28c968333ed35acb2d8437b359 https://code.google.com/p/go.tools #

Patch Set 3 : diff -r 7a206220eb24ca28c968333ed35acb2d8437b359 https://code.google.com/p/go.tools #

Patch Set 4 : diff -r 7a206220eb24ca28c968333ed35acb2d8437b359 https://code.google.com/p/go.tools #

Total comments: 2

Patch Set 5 : diff -r 40c49f5c2b6473be5a4bfe96018905882e8b949b https://code.google.com/p/go.tools #

Patch Set 6 : diff -r 40c49f5c2b6473be5a4bfe96018905882e8b949b https://code.google.com/p/go.tools #

Patch Set 7 : diff -r 5f3a656edf578923e66d3cebefdbaaf02b3faa60 https://code.google.com/p/go.tools #

Unified diffs Side-by-side diffs Delta from patch set Stats (+535 lines, -38 lines) Patch
M cmd/callgraph/main.go View 1 2 3 4 5 chunks +62 lines, -38 lines 0 comments Download
A go/callgraph/cha/cha.go View 1 2 3 1 chunk +120 lines, -0 lines 0 comments Download
A go/callgraph/cha/cha_test.go View 1 1 chunk +107 lines, -0 lines 0 comments Download
A go/callgraph/cha/testdata/func.go View 1 1 chunk +23 lines, -0 lines 0 comments Download
A go/callgraph/cha/testdata/iface.go View 1 1 chunk +65 lines, -0 lines 0 comments Download
A go/callgraph/cha/testdata/recv.go View 1 1 chunk +37 lines, -0 lines 0 comments Download
A go/callgraph/static/static.go View 1 2 3 4 1 chunk +33 lines, -0 lines 0 comments Download
A go/callgraph/static/static_test.go View 1 2 3 4 5 1 chunk +88 lines, -0 lines 0 comments Download

Messages

Total messages: 7
adonovan
Hello sameer@golang.org (cc: golang-codereviews@googlegroups.com, gri@golang.org), I'd like you to review this change to https://code.google.com/p/go.tools
10 years, 8 months ago (2014-11-14 18:45:25 UTC) #1
minux
On Fri, Nov 14, 2014 at 1:45 PM, adonovan via golang-codereviews <golang-codereviews@googlegroups.com> wrote: > (This ...
10 years, 8 months ago (2014-11-14 19:04:58 UTC) #2
adonovan
On 14 November 2014 14:04, minux <minux@golang.org> wrote: > On Fri, Nov 14, 2014 at ...
10 years, 8 months ago (2014-11-14 19:10:19 UTC) #3
Sameer Ajmani
https://codereview.appspot.com/176780043/diff/60001/cmd/callgraph/main.go File cmd/callgraph/main.go (right): https://codereview.appspot.com/176780043/diff/60001/cmd/callgraph/main.go#newcode191 cmd/callgraph/main.go:191: for f := range ssautil.AllFunctions(prog) { Consider hoisting this ...
10 years, 8 months ago (2014-11-17 20:50:24 UTC) #4
adonovan
https://codereview.appspot.com/176780043/diff/60001/cmd/callgraph/main.go File cmd/callgraph/main.go (right): https://codereview.appspot.com/176780043/diff/60001/cmd/callgraph/main.go#newcode191 cmd/callgraph/main.go:191: for f := range ssautil.AllFunctions(prog) { On 2014/11/17 20:50:23, ...
10 years, 8 months ago (2014-11-17 21:38:08 UTC) #5
Sameer Ajmani
On 2014/11/17 21:38:08, adonovan wrote: > https://codereview.appspot.com/176780043/diff/60001/cmd/callgraph/main.go > File cmd/callgraph/main.go (right): > > https://codereview.appspot.com/176780043/diff/60001/cmd/callgraph/main.go#newcode191 > ...
10 years, 8 months ago (2014-11-18 20:23:12 UTC) #6
adonovan
10 years, 8 months ago (2014-11-21 16:07:56 UTC) #7
*** Submitted as
https://code.google.com/p/go/source/detail?r=159a6f08c3a6&repo=tools ***

cmd/callgraph: add -algo=static and -algo=cha options.

"static" ignores dynamic calls altogether.

"cha" uses Class Hierarchy Analysis, which assumes that a
dynamic call may dispatch to any func or method that satisfies
the type.

Both these algorithms can work on partial programs,
e.g. libraries without a main function or tests.

(This feature was requested after my talk last night.)

+ Tests.

LGTM=sameer
R=sameer, minux
CC=golang-codereviews, gri
https://codereview.appspot.com/176780043
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b