1
0
mirror of https://github.com/golang/go synced 2024-11-19 02:04:42 -07:00
go/ssa
Alan Donovan c28bf6e069 go.tools/ssa: extend debug information to arbitrary ast.Exprs.
CanonicalPos was inadequate since many pairs of instruction share the same pos (e.g. Allocs and Phis).  Instead, we generalize the DebugRef instruction to associate not just Idents but Exprs with ssa.Values.

We no longer store any DebugRefs for constant expressions, to save space.  (The type and value of such expressions can be obtained by other means, at a cost in complexity.)

Function.ValueForExpr queries the DebugRef info to return the ssa.Value of a given Expr.

Added tests.

Also:
- the DebugInfo flag is now per package, not global.
   It must be set between Create and Build phases if desired.
- {Value,Instruction}.Pos() documentation updated: we still maintain
  this information in the instruction stream even in non-debug mode,
  but we make fewer claims about its invariants.
- Go and Defer instructions can now use their respective go/defer
   token positions (not the call's lparen), so they do.
- SelectState:
     Posn token.Pos indicates the <- position
     DebugNode ast.Expr is the send stmt or receive expr.
- In building SelectStmt, we introduce extra temporaries in debug
   mode to hold the result of the receive in 'case <-ch' even though
   this value isn't ordinarily needed.
- Use *SelectState (indirectly) since the struct is getting bigger.
- Document some missing instructions in doc.go.

R=gri
CC=golang-dev
https://golang.org/cl/12147043
2013-07-31 13:13:05 -04:00
..
interp go.tools/ssa/interp: fix build 2013-07-30 20:28:18 -07:00
testdata go.tools/ssa: extend debug information to arbitrary ast.Exprs. 2013-07-31 13:13:05 -04:00
blockopt.go go.tools/ssa: combine CallCommon.{Recv,Func} as Value. 2013-07-26 14:06:26 -04:00
builder_test.go go.tools/ssa: extend debug information to arbitrary ast.Exprs. 2013-07-31 13:13:05 -04:00
builder.go go.tools/ssa: avoid calling go/types.NewSelection, and eliminate it. 2013-07-30 16:36:58 -04:00
const.go go.tools/ssa: s/Literal/Const/g, s/Constant/NamedConst/g 2013-07-16 13:50:08 -04:00
create.go go.tools/ssa: extend debug information to arbitrary ast.Exprs. 2013-07-31 13:13:05 -04:00
doc.go go.tools/ssa: extend debug information to arbitrary ast.Exprs. 2013-07-31 13:13:05 -04:00
dom.go go.tools/ssa: un-export Function.FullName. Use String. 2013-06-26 12:38:08 -04:00
emit.go go.tools/ssa: extend debug information to arbitrary ast.Exprs. 2013-07-31 13:13:05 -04:00
example_test.go go.tools/ssa: extend debug information to arbitrary ast.Exprs. 2013-07-31 13:13:05 -04:00
func.go go.tools/ssa: extend debug information to arbitrary ast.Exprs. 2013-07-31 13:13:05 -04:00
lift.go go.tools/ssa: s/Literal/Const/g, s/Constant/NamedConst/g 2013-07-16 13:50:08 -04:00
lvalue.go go.tools/ssa: extend debug information to arbitrary ast.Exprs. 2013-07-31 13:13:05 -04:00
print.go go.tools/ssa: extend debug information to arbitrary ast.Exprs. 2013-07-31 13:13:05 -04:00
promote.go go.tools/ssa: avoid calling go/types.NewSelection, and eliminate it. 2013-07-30 16:36:58 -04:00
sanity.go go.tools/ssa: s/Literal/Const/g, s/Constant/NamedConst/g 2013-07-16 13:50:08 -04:00
source_test.go go.tools/ssa: extend debug information to arbitrary ast.Exprs. 2013-07-31 13:13:05 -04:00
source.go go.tools/ssa: extend debug information to arbitrary ast.Exprs. 2013-07-31 13:13:05 -04:00
ssa.go go.tools/ssa: extend debug information to arbitrary ast.Exprs. 2013-07-31 13:13:05 -04:00
ssadump.go go.tools/ssa: extend debug information to arbitrary ast.Exprs. 2013-07-31 13:13:05 -04:00
stdlib_test.go go.tools/ssa: extend debug information to arbitrary ast.Exprs. 2013-07-31 13:13:05 -04:00
util.go go.tools/ssa: (another) major refactoring of method-set logic. 2013-07-26 11:22:34 -04:00
visit.go go.tools/ssa: avoid calling go/types.NewSelection, and eliminate it. 2013-07-30 16:36:58 -04:00