tools/go/ssa
Alan Donovan 997b3545fd go/types: change {Type,Object,Selection}String to accept a Qualifier function
The optional Qualifier function determines what prefix to attach to
package-level names, enabling clients to qualify packages in different
ways, for example, using only the package name instead of its complete
path, or using the locally appropriate name for package given a set of
(possibly renaming) imports.

Prior to this change, clients wanting this behavior had to copy
hundreds of lines of complex printing logic.

Fun fact: (*types.Package).Path and (*types.Package).Name are valid
Qualifier functions.

We provide the RelativeTo helper function to create Qualifiers so that
the old behavior remains a one-liner.

Fixes golang/go#11133

Change-Id: Ibd63f639c7b3aa1738826d6165f2d810efeb8293
Reviewed-on: https://go-review.googlesource.com/11692
Reviewed-by: Robert Griesemer <gri@golang.org>
2015-06-30 19:00:00 +00:00
..
interp go/ssa/interp: disable interpretation of packages that have sprouted Examples 2015-06-29 19:24:15 +00:00
ssautil go/loader: eliminate ImportFromBinary option and PackageCreated hook 2015-04-17 18:58:17 +00:00
testdata go/ssa: fix incorrect SSA code for composite literals 2015-03-17 14:26:39 +00:00
blockopt.go go.tools/go/ssa: don't attempt fusion on single-pred blocks with φ-nodes 2014-04-24 09:08:21 -04:00
builder.go go/ssa/ssautil: break ssa->loader dependency 2015-04-14 18:01:36 +00:00
builder_test.go go/loader: eliminate ImportFromBinary option and PackageCreated hook 2015-04-17 18:58:17 +00:00
const.go go.tools: use golang.org/x/... import paths 2014-11-10 08:50:40 +11:00
create.go go/loader: eliminate ImportFromBinary option and PackageCreated hook 2015-04-17 18:58:17 +00:00
doc.go tools: add import comments. 2014-12-09 22:42:16 +00:00
dom.go go.tools/go/ssa: use bytes.Buffer instead of io.Writer. 2014-01-28 17:48:10 -05:00
emit.go go/ssa: fix incorrect SSA code for composite literals 2015-03-17 14:26:39 +00:00
example_test.go go/loader: eliminate ImportFromBinary option and PackageCreated hook 2015-04-17 18:58:17 +00:00
func.go go/types: change {Type,Object,Selection}String to accept a Qualifier function 2015-06-30 19:00:00 +00:00
lift.go go.tools: use golang.org/x/... import paths 2014-11-10 08:50:40 +11:00
lvalue.go go/ssa: fix incorrect SSA code for composite literals 2015-03-17 14:26:39 +00:00
methods.go go/ssa: simplify TypesWithMethodSets 2015-01-22 14:03:32 +00:00
mode.go go/ssa: standardize parsing of BuilderMode flags. 2015-02-18 18:34:24 +00:00
print.go go/types: change {Type,Object,Selection}String to accept a Qualifier function 2015-06-30 19:00:00 +00:00
sanity.go go/ssa: treat declared init functions less specially 2015-03-05 20:09:21 +00:00
source.go go/ssa/ssautil: break ssa->loader dependency 2015-04-14 18:01:36 +00:00
source_test.go go/ssa: acquire TestEnclosingFunction from go/loader package. 2015-04-21 16:27:33 +00:00
ssa.go go/types: move MethodSetCache into package go/types/typeutil 2015-06-05 17:34:01 +00:00
stdlib_test.go go/loader: eliminate ImportFromBinary option and PackageCreated hook 2015-04-17 18:58:17 +00:00
testmain.go go/ssa: fix build (remove unused params to types.NewSignature) 2015-06-13 00:57:15 +00:00
testmain_test.go go/loader: eliminate ImportFromBinary option and PackageCreated hook 2015-04-17 18:58:17 +00:00
util.go go/ssa: fix build (remove unused params to types.NewSignature) 2015-06-13 00:57:15 +00:00
wrappers.go go/ssa: fix build (remove unused params to types.NewSignature) 2015-06-13 00:57:15 +00:00