1
0
mirror of https://github.com/golang/go synced 2024-11-18 20:04:52 -07:00
go/oracle
Alan Donovan e8afbfad8c go.tools/importer: API rethink.
The Importer type has been replaced with Config and Program.

Clients populate a Config, directly or more usually via
convenience functions.  They then call its Load() method to do
all of the typechecking and transitive-closure computation.

ssa.NewProgram and ssa.CreatePackages have been fused into
ssa.Create, which now cannot fail, since (*Config).Load()
reports all type errors.

Also:
- The addition of an ssa.GlobalDebug builder mode flag
  eliminates a loop-over-packages repeated in many clients.
- PackageInfo.Err flag unexported.  Clients never see bad infos now.
- cmd/ssadump: now only looks for func "main" in package "main".
- importsOf deleted, was dead code.

STILL TODO:
- ParseFile seems like API creep (though it's convenient)
  and CreateFromFiles is dangerous (w.r.t. FileSet identity).
  Need to think more...
- the need for clients to rely on elementwise correspondence
  of Config.CreatePkgs and Program.Created is a little sad.
- The command-line interface has not changed.
  That will happen in a follow-up.
  r recommends using a repeated flag: -package p -package q ...

R=gri
CC=axwalk, frederik.zipp, golang-codereviews
https://golang.org/cl/49530047
2014-01-15 21:37:55 -05:00
..
serial go.tools/oracle: implements: now shows whole-program implements relation for selected type. 2013-12-13 18:00:55 -05:00
testdata/src go.tools/oracle: adjust golden output to new names 2014-01-10 16:05:14 -08:00
callees.go go.tools/oracle: improvements to command set and performance. 2013-12-13 10:04:55 -05:00
callers.go go.tools/oracle: improvements to command set and performance. 2013-12-13 10:04:55 -05:00
callgraph.go go.tools/oracle: improvements to command set and performance. 2013-12-13 10:04:55 -05:00
callstack.go go.tools/oracle: improvements to command set and performance. 2013-12-13 10:04:55 -05:00
definition.go go.tools/oracle: improvements to command set and performance. 2013-12-13 10:04:55 -05:00
describe.go go.tools/oracle: improvements to command set and performance. 2013-12-13 10:04:55 -05:00
freevars.go go.tools/oracle: improvements to command set and performance. 2013-12-13 10:04:55 -05:00
implements.go go.tools/oracle: implements: now shows whole-program implements relation for selected type. 2013-12-13 18:00:55 -05:00
oracle_test.go go.tools/importer: API rethink. 2014-01-15 21:37:55 -05:00
oracle.go go.tools/importer: API rethink. 2014-01-15 21:37:55 -05:00
peers.go go.tools/go/types: use types.ChanDir instead of ast.ChanDir 2013-12-17 15:45:01 -08:00
pointsto.go go.tools/oracle: improvements to command set and performance. 2013-12-13 10:04:55 -05:00
pos.go go.tools/oracle: improvements to command set and performance. 2013-12-13 10:04:55 -05:00
referrers.go go.tools/oracle: improvements to command set and performance. 2013-12-13 10:04:55 -05:00
TODO go.tools/oracle: implements: now shows whole-program implements relation for selected type. 2013-12-13 18:00:55 -05:00
what.go go.tools/oracle: implements: now shows whole-program implements relation for selected type. 2013-12-13 18:00:55 -05:00