1
0
mirror of https://github.com/golang/go synced 2024-11-19 13:54:56 -07:00
go/oracle/testdata/src/main/calls.golden

108 lines
2.8 KiB
Plaintext
Raw Normal View History

-------- @describe describe-A-x --------
definition of var x *int
value may point to these labels:
a
b
-------- @callstack callstack-A --------
Found a call path from root to main.A
main.A
dynamic function call from main.apply
static function call from main.main
-------- @describe describe-B-x --------
definition of var x *int
value may point to these labels:
a
b
-------- @callers callers-B --------
main.B is called from these 1 sites:
dynamic function call from main.apply
-------- @callees callees-apply --------
this dynamic function call dispatches to:
main.A
main.B
-------- @callers callers-apply --------
main.apply is called from these 2 sites:
static function call from main.main
static function call from main.main
-------- @callers callers-store --------
main.store is called from these 2 sites:
static function call from main.main
static function call from main.main
-------- @describe describe-result-f --------
reference to var f func() *int
defined here
value may point to these labels:
func@50.7
-------- @callees callees-main.call-f --------
this dynamic function call dispatches to:
func@50.7
-------- @callers callers-main.call --------
main.call is called from these 2 sites:
static function call from main.main
static function call from main.main
-------- @callees callees-main-apply1 --------
this static function call dispatches to:
main.apply
-------- @describe describe-pc --------
definition of var pc *int
value may point to these labels:
c
-------- @describe describe-pd --------
reference to var pd *int
defined here
value may point to these labels:
d
-------- @callees callees-err-no-call --------
Error: there is no function call here
-------- @callees callees-err-builtin --------
Error: this is a call to the built-in 'print' operator
-------- @callees callees-err-conversion --------
Error: this is a type conversion, not a function call
-------- @callees callees-err-bad-selection --------
Error: ambiguous selection within function call (or conversion)
-------- @callees callees-err-deadcode1 --------
go.tools/oracle: add option to output results in JSON syntax. See json.go for interface specification. Example usage: % oracle -format=json -mode=callgraph code.google.com/p/go.tools/cmd/oracle + Tests, based on (small) golden files. Overview: Each <query>Result structure has been "lowered" so that all but the most trivial logic in each display() function has been moved to the main query. Each one now has a toJSON method that populates a json.Result struct. Though the <query>Result structs are similar to the correponding JSON protocol, they're not close enough to be used directly; for example, the former contain richer semantic entities (token.Pos, ast.Expr, ssa.Value, pointer.Pointer, etc) whereas JSON contains only their printed forms using Go basic types. The choices of what levels of abstractions the two sets of structs should have is somewhat arbitrary. We may want richer information in the JSON output in future. Details: - oracle.Main has been split into oracle.Query() and the printing of the oracle.Result. - the display() method no longer needs an *oracle param, only a print function. - callees: sort the result for determinism. - callees: compute the union across all contexts. - callers: sort the results for determinism. - describe(package): fixed a bug in the predicate for method accessibility: an unexported method defined in pkg A may belong to a type defined in package B (via embedding/promotion) and may thus be accessible to A. New accessibleMethods() utility fixes this. - describe(type): filter methods by accessibility. - added tests of 'callgraph'. - pointer: eliminated the 'caller CallGraphNode' parameter from pointer.Context.Call callback since it was redundant w.r.t site.Caller(). - added warning if CGO_ENABLED is unset. R=crawshaw CC=golang-dev https://golang.org/cl/13270045
2013-09-03 13:29:02 -06:00
Error: this call site is unreachable in this analysis
-------- @callees callees-err-nil-func --------
dynamic function call on nil value
-------- @callees callees-err-nil-interface --------
dynamic method call on nil value
-------- @callees callees-err-deadcode2 --------
this static function call dispatches to:
main.main
go.tools/oracle: add option to output results in JSON syntax. See json.go for interface specification. Example usage: % oracle -format=json -mode=callgraph code.google.com/p/go.tools/cmd/oracle + Tests, based on (small) golden files. Overview: Each <query>Result structure has been "lowered" so that all but the most trivial logic in each display() function has been moved to the main query. Each one now has a toJSON method that populates a json.Result struct. Though the <query>Result structs are similar to the correponding JSON protocol, they're not close enough to be used directly; for example, the former contain richer semantic entities (token.Pos, ast.Expr, ssa.Value, pointer.Pointer, etc) whereas JSON contains only their printed forms using Go basic types. The choices of what levels of abstractions the two sets of structs should have is somewhat arbitrary. We may want richer information in the JSON output in future. Details: - oracle.Main has been split into oracle.Query() and the printing of the oracle.Result. - the display() method no longer needs an *oracle param, only a print function. - callees: sort the result for determinism. - callees: compute the union across all contexts. - callers: sort the results for determinism. - describe(package): fixed a bug in the predicate for method accessibility: an unexported method defined in pkg A may belong to a type defined in package B (via embedding/promotion) and may thus be accessible to A. New accessibleMethods() utility fixes this. - describe(type): filter methods by accessibility. - added tests of 'callgraph'. - pointer: eliminated the 'caller CallGraphNode' parameter from pointer.Context.Call callback since it was redundant w.r.t site.Caller(). - added warning if CGO_ENABLED is unset. R=crawshaw CC=golang-dev https://golang.org/cl/13270045
2013-09-03 13:29:02 -06:00
-------- @callstack callstack-err-deadcode --------
main.deadcode is unreachable in this analysis scope
-------- @callees callees-err-deadcode3 --------
Error: this call site is unreachable in this analysis
-------- @callers callers-global --------
main.init is called from these 1 sites:
the root of the call graph
-------- @callstack callstack-init --------
Found a call path from root to main.init$1
main.init$1
static function call from main.init