mirror of
https://github.com/golang/go
synced 2024-11-19 07:34:44 -07:00
9f640c2abb
A DebugRef associates a source expression E with an ssa.Value V, but until now did not record whether V was the value or the address of E. So, we would guess from the "pointerness" of the Value, leading to confusion in some cases, e.g. type N *N var n N n = &n // lvalue and rvalue are both pointers Now we explicitly record 'IsAddress bool' in DebugRef, and plumb this everywhere: through (*Function).ValueForExpr and (*Program).VarValue, all the way to forming the pointer analysis query. Also: - VarValue now treats each reference to a global distinctly, just like it does for other vars. So: var g int func f() { g = 1 // VarValue(g) == Const(1:int), !isAddress print(g) // VarValue(g) == Global(g), isAddress } - DebugRefs are not emitted for references to predeclared identifiers (nil, built-in). - DebugRefs no longer prevent lifting of an Alloc var into a register; now we update or discard the debug info. - TestValueForExpr: improve coverage of ssa.EnclosingFunction by putting expectations in methods and init funcs, not just normal funcs. - oracle: fix golden file broken by recent (*types.Var).IsField change. R=gri CC=golang-dev https://golang.org/cl/16610045 |
||
---|---|---|
.. | ||
callgraph2.go | ||
callgraph2.golden | ||
callgraph-json.go | ||
callgraph-json.golden | ||
callgraph.go | ||
callgraph.golden | ||
calls-json.go | ||
calls-json.golden | ||
calls.go | ||
calls.golden | ||
describe-json.go | ||
describe-json.golden | ||
describe.go | ||
describe.golden | ||
freevars.go | ||
freevars.golden | ||
implements.go | ||
implements.golden | ||
imports.go | ||
imports.golden | ||
multi.go | ||
peers-json.go | ||
peers-json.golden | ||
peers.go | ||
peers.golden | ||
referrers-json.go | ||
referrers-json.golden | ||
reflection.go | ||
reflection.golden |