tools/go
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
..
ast/astutil imports, go/ast/astutil: do not make grouped imports non-grouped when removing 2017-02-13 18:56:44 +00:00
buildutil x/tools/go/buildutil: remove unused function 2017-03-01 14:53:57 +00:00
callgraph tools: updates for minimum Go version 1.6 2017-02-07 21:06:19 +00:00
gccgoexportdata go/gccgoexportdata: correctly handle archive files containing string tables 2016-11-09 21:28:38 +00:00
gcexportdata go/gcexportdata: better error when reading exportdata directly from archive 2016-11-30 19:52:27 +00:00
gcimporter15 x/tools: simplify and format code 2017-02-28 14:15:42 +00:00
internal/gccgoimporter x/tools/go/internal/gccgoimporter: remove unused method 2017-03-01 14:54:10 +00:00
loader go/loader: don't create types.Package for "unsafe" 2017-03-02 21:55:26 +00:00
pointer go/pointer: implement extended queries 2017-03-06 04:11:41 +00:00
ssa go/ssa: create an 'init' function even if len(files)==0 2017-03-03 14:03:29 +00:00
types/typeutil tools: updates for minimum Go version 1.6 2017-02-07 21:06:19 +00:00
vcs go/vcs: accept plain file for .vcs (instead of directory) 2016-10-13 13:57:49 +00:00