]> Cypherpunks repositories - gostls13.git/commit
exp/ssa: reimplement logic for field selection.
authorAlan Donovan <adonovan@google.com>
Tue, 26 Feb 2013 18:32:22 +0000 (13:32 -0500)
committerAlan Donovan <adonovan@google.com>
Tue, 26 Feb 2013 18:32:22 +0000 (13:32 -0500)
commitbd92dd6a5f2576fbf8144da0e531a57b4ebc8961
treee838fbd1b8f90d316bf35266f1c370f5be9f3f03
parentc4c38312e532195988cc5f657261ce9cd501729b
exp/ssa: reimplement logic for field selection.

The previous approach desugared the ast.SelectorExpr
to make implicit field selections explicit.  But:
1) it was clunky since it required allocating temporary
   syntax trees.
2) it was not thread-safe since it required poking
   types into the shared type map for the new ASTs.
3) the desugared syntax had no place to represent the
   package lexically enclosing each implicit field
   selection, so it was as if they all occurred in the
   same package as the explicit field selection.
   This meant unexported field names changed meaning.

This CL does what I should have done all along: just
generate the SSA instructions directly from the original
AST and the promoted field information.

Also:
- add logStack util for paired start/end log messages.
  Useful for debugging crashes.

R=gri
CC=golang-dev
https://golang.org/cl/7395052
src/pkg/exp/ssa/builder.go
src/pkg/exp/ssa/func.go
src/pkg/exp/ssa/promote.go
src/pkg/exp/ssa/ssa.go
src/pkg/exp/ssa/util.go