Go to file
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
cmd go.tools/cmd/oracle: use -pos=file:#start,#end syntax to indicate half-open [start,end) extent of byte offsets. 2013-09-08 22:10:11 -04:00
dashboard go.tools/dashboard: implement dashboard using vcs package. 2013-08-27 21:52:18 -07:00
go go.tools/go/types: fix unsafe.Pointer conversions 2013-09-09 16:41:46 -07:00
godoc go.tools/cmd/godoc: don't list factory functions under types in builtin package 2013-08-28 09:39:02 +10:00
gotype go.tools/gotype: fix build 2013-07-19 07:52:43 -07:00
importer go.tools/importer: generalize command-line syntax. 2013-09-06 18:13:57 -04:00
oracle go.tools/oracle: describe: query content of lvalues, not their address. 2013-09-09 21:06:25 -04:00
pointer go.tools/oracle: describe: query content of lvalues, not their address. 2013-09-09 21:06:25 -04:00
ssa go.tools/importer: generalize command-line syntax. 2013-09-06 18:13:57 -04:00
.hgignore go.empty: prototype for new subrepository 2012-01-25 14:45:13 -05:00
AUTHORS go.empty: prototype for new subrepository 2012-01-25 14:45:13 -05:00
CONTRIBUTORS go.empty: prototype for new subrepository 2012-01-25 14:45:13 -05:00
LICENSE LICENSE: add 2012-03-17 15:20:58 +11:00
PATENTS go.empty: add PATENTS file to the subrepo. 2012-04-16 11:24:04 +10:00
README go.tools: provide the right README 2013-05-17 12:55:10 -07:00
codereview.cfg go.empty: prototype for new subrepository 2012-01-25 14:45:13 -05:00

README

This subrepository holds the source for various packages and tools that support
the Go programming language.

Although at least some of the tools themselves will be included in binary Go distributions,
the packages from which they are built are of little interest to most Go programmers.

To submit changes to this repository, see http://golang.org/doc/contribute.html.