tools/go/pointer
Dominik Honnef a99f4ece36 go/pointer: implement extended queries
The existing API for querying values only allows directly querying
pointer-like values, or pointers to such values. The new, extended
queries make it possible to destructure values and access arbitrarily
nested pointers, such as fields in structs, or specific values in
tuples.

We use single Go expressions as the queries, which we further restrict
to a subset of the language (indexing, field access, pointer
dereferences and channel receives).

Instead of adding another map to Result, we return a *Pointer and
populate it during analysis. This does mean that a Config cannot be
reused for multiple analyses, as it now holds analysis-specific state.
That is, however, not a big problem as reusing one Config had little
use.

Since the new API can do everything the old could, it deprecates
AddQuery and AddIndirectQuery.

Change-Id: I4b2ae7d85c462bc7faa6bab76456106e76be5a65
Reviewed-on: https://go-review.googlesource.com/37635
Reviewed-by: Alan Donovan <adonovan@google.com>
2017-03-06 04:11:41 +00:00
..
testdata go/pointer: implement extended queries 2017-03-06 04:11:41 +00:00
TODO go.tools/go/pointer: eliminate TODOs regarding sound treatment of unsafe.Pointer. 2014-07-08 10:11:36 -04:00
analysis.go go/pointer: implement extended queries 2017-03-06 04:11:41 +00:00
api.go go/pointer: implement extended queries 2017-03-06 04:11:41 +00:00
callgraph.go go.tools: use golang.org/x/... import paths 2014-11-10 08:50:40 +11:00
constraint.go tools: updates for minimum Go version 1.6 2017-02-07 21:06:19 +00:00
doc.go tools: updates for minimum Go version 1.6 2017-02-07 21:06:19 +00:00
example_test.go go/ssa: rename some API features (incompatible change) 2015-08-31 22:20:12 +00:00
gen.go go/pointer: implement extended queries 2017-03-06 04:11:41 +00:00
hvn.go x/tools/go: gofmt -s -w 2017-02-15 21:43:35 +00:00
intrinsics.go tools: updates for minimum Go version 1.6 2017-02-07 21:06:19 +00:00
labels.go tools: updates for minimum Go version 1.6 2017-02-07 21:06:19 +00:00
opt.go go/pointer: implement extended queries 2017-03-06 04:11:41 +00:00
pointer_test.go go/pointer: implement extended queries 2017-03-06 04:11:41 +00:00
print.go go/pointer: implement pointer equivalence via hash-value numbering, a pre-solver optimization. 2014-06-16 15:46:07 -04:00
query.go go/pointer: implement extended queries 2017-03-06 04:11:41 +00:00
query_test.go go/pointer: implement extended queries 2017-03-06 04:11:41 +00:00
reflect.go tools: updates for minimum Go version 1.6 2017-02-07 21:06:19 +00:00
solve.go tools: updates for minimum Go version 1.6 2017-02-07 21:06:19 +00:00
stdlib_test.go go/ssa: support custom TestMain functions in test packages 2016-10-19 17:50:59 +00:00
util.go go/pointer: implement extended queries 2017-03-06 04:11:41 +00:00