1
0
mirror of https://github.com/golang/go synced 2024-10-01 01:28:32 -06:00
Commit Graph

3 Commits

Author SHA1 Message Date
Alan Donovan
608d57b3ae cmd/guru: call{ers,stack}: avoid pointer analysis where possible
As an optimization, the callers and callstack queries now avoid the
relatively costly pointer analysis in some common cases:

The callers of a function that is never address-taken can be enumerated
directly from the SSA representation.

Similarly, the callstack can be computed initially by ignoring dynamic
call edges; we run the pointer analysis only if no path is found in this
partial callgraph.  As a bonus, this also causes the tool to
preferentially report all-static callpaths.

A callers query on fmt.Errorf now completes in 3 seconds instead of 8,
and a callstack query completes in 2 seconds instead of 8.

The new code is covered by the existing tests.

Change-Id: I777ea07a1cdb6cadcc2a94952f553b6b036e7382
Reviewed-on: https://go-review.googlesource.com/19496
Reviewed-by: Michael Matloob <matloob@golang.org>
2016-02-12 23:38:00 +00:00
Alan Donovan
37bb37ec1c cmd/guru: fix bad import, and run gofmt
Change-Id: Ieb5c732bad494942f7b45ac5a1b605e810436e87
Reviewed-on: https://go-review.googlesource.com/19478
Reviewed-by: Alan Donovan <adonovan@google.com>
2016-02-12 03:58:01 +00:00
Alan Donovan
7347379304 cmd/guru: rename oracle to guru, copying it to a single package
See plans at:
https://docs.google.com/document/d/1UErU12vR7jTedYvKHVNRzGPmXqdMASZ6PfE7B-p6sIg/edit#heading=h.t5rbcuy7di7j

Change-Id: I369747e0ce8cd42a2975eb0f651a2e5fba47cf9e
Reviewed-on: https://go-review.googlesource.com/19475
Reviewed-by: Alan Donovan <adonovan@google.com>
2016-02-12 03:38:58 +00:00