mirror of
https://github.com/golang/go
synced 2024-11-19 00:04:40 -07:00
25a0cc4bfd
The existing standalone Query function builds an importer, ssa.Program, oracle, and query position, executes the query and returns the result. For clients (such as Frederik Zipp's web-based github.com/fzipp/pythia tool) that wish to load the program once and make several queries, we now expose these as separate operations too. Here's a client, in pseudocode: o := oracle.New(...) for ... { qpos := o.ParseQueryPos(...) res := o.Query(mode, qpos) print result } NB: this is a slight deoptimisation in the one-shot case since we have to build the entire SSA program with debug info, not just the query package, since we now don't know the query package at that time. The 'exact' param to ParseQueryPos needs more thought since its ideal value is a function of the query mode. This will do for now. Details: - expose Oracle type, New() func and Query() method. - expose QueryPos type and ParseQueryPos func. - improved package doc comment. - un-exposed the "needs" bits. - added test. R=crawshaw CC=frederik.zipp, golang-dev https://golang.org/cl/13810043 |
||
---|---|---|
.. | ||
json | ||
testdata/src | ||
callees.go | ||
callers.go | ||
callgraph.go | ||
callstack.go | ||
describe.go | ||
freevars.go | ||
implements.go | ||
oracle_test.go | ||
oracle.go | ||
peers.go | ||
referrers.go |