1
0
mirror of https://github.com/golang/go synced 2024-11-19 07:04:43 -07:00
go/oracle/testdata/src/main
Alan Donovan 927e0f9da6 go.tools/oracle: describe: query content of lvalues, not their address.
Background: some ssa.Values represent lvalues, e.g.
      var g = new(string)
the *ssa.Global g is a **string, the address of what users
think of as the global g.

Querying pts(g) returns a singleton containing the object g, a
*string.  What users really want to see is what that in turn
points to, i.e. the label for the call to new().

This change now lets users make "indirect" pointer queries,
i.e. for pts(*v) where v is an ssa.Value.  The oracle makes an
indirect query if the type of the ssa.Value differs from the
source expression type by a pointer, i.e. it's an lvalue.

In other words, we're hiding the fact that compilers (e.g. ssa) internally represent globals by their address.

+ Tests.

This serendipitously fixed an outstanding bug mentioned in the
describe.go

R=crawshaw
CC=golang-dev
https://golang.org/cl/13532043
2013-09-09 21:06:25 -04:00
..
callgraph-json.go go.tools/oracle: add option to output results in JSON syntax. 2013-09-03 15:29:02 -04:00
callgraph-json.golden go.tools/oracle: add option to output results in JSON syntax. 2013-09-03 15:29:02 -04:00
callgraph.go go.tools/oracle: add option to output results in JSON syntax. 2013-09-03 15:29:02 -04:00
callgraph.golden go.tools/oracle: add option to output results in JSON syntax. 2013-09-03 15:29:02 -04:00
calls-json.go go.tools/oracle: add option to output results in JSON syntax. 2013-09-03 15:29:02 -04:00
calls-json.golden go.tools/oracle: add option to output results in JSON syntax. 2013-09-03 15:29:02 -04:00
calls.go go.tools/oracle: an oracle that answers questions about Go source code. 2013-08-27 17:58:26 -04:00
calls.golden go.tools/oracle: add option to output results in JSON syntax. 2013-09-03 15:29:02 -04:00
describe-json.go go.tools/oracle: add option to output results in JSON syntax. 2013-09-03 15:29:02 -04:00
describe-json.golden go.tools/importer: generalize command-line syntax. 2013-09-06 18:13:57 -04:00
describe.go go.tools/oracle: describe: query content of lvalues, not their address. 2013-09-09 21:06:25 -04:00
describe.golden go.tools/oracle: describe: query content of lvalues, not their address. 2013-09-09 21:06:25 -04:00
freevars.go go.tools/oracle: an oracle that answers questions about Go source code. 2013-08-27 17:58:26 -04:00
freevars.golden go.tools/oracle: add option to output results in JSON syntax. 2013-09-03 15:29:02 -04:00
implements.go go.tools/oracle: an oracle that answers questions about Go source code. 2013-08-27 17:58:26 -04:00
implements.golden go.tools/oracle: an oracle that answers questions about Go source code. 2013-08-27 17:58:26 -04:00
imports.go go.tools/oracle: an oracle that answers questions about Go source code. 2013-08-27 17:58:26 -04:00
imports.golden go.tools/oracle: describe: query content of lvalues, not their address. 2013-09-09 21:06:25 -04:00
peers-json.go go.tools/oracle: add option to output results in JSON syntax. 2013-09-03 15:29:02 -04:00
peers-json.golden go.tools/oracle: add option to output results in JSON syntax. 2013-09-03 15:29:02 -04:00
peers.go go.tools/oracle: an oracle that answers questions about Go source code. 2013-08-27 17:58:26 -04:00
peers.golden go.tools/importer: generalize command-line syntax. 2013-09-06 18:13:57 -04:00