1
0
mirror of https://github.com/golang/go synced 2024-11-18 23:05:06 -07:00
go/ssa
Alan Donovan 5db6491e90 go.tools/ssa/interp: fixes to equivalence relations.
- This change implements the correct type-based equivalence
  relation for aggregate types. e.g. comparison of struct
  types no longer compares the anonymous fields.  We do
  analogous things for hash().

- equals() and eqnil() have been separated: the former panics
  for uncomparable types, the latter permits comparisons of
  slice/map/func types against a literal nil and is intended
  for use only by "static" ssa.BinOp(EQL), not "dynamic" slice
  comparisons encountered during (e.g.) interface comparisons,
  which should panic regardless of operand nilness.

- we use a (global) typemap.Hasher to compute type hashes;
  hashing the Type.String() value was not sound.

+ tests.

NB, this change unearthed a bug in defer/recover within
init(); it will be fixed in a followup change.

R=gri, crawshaw
CC=golang-dev
https://golang.org/cl/13719043
2013-09-16 15:22:19 -04:00
..
interp go.tools/ssa/interp: fixes to equivalence relations. 2013-09-16 15:22:19 -04:00
testdata go.tools/ssa: fix bug in Program.VarValue. 2013-08-27 17:57:55 -04:00
blockopt.go go.tools: add copyright messages to source files. 2013-08-27 18:49:13 -04:00
builder_test.go go.tools/importer: generalize command-line syntax. 2013-09-06 18:13:57 -04:00
builder.go go.tools/go/types: separate package descriptor from package object 2013-09-13 09:52:57 -07:00
const.go go.tools: add copyright messages to source files. 2013-08-27 18:49:13 -04:00
create.go go.tools/importer: generalize command-line syntax. 2013-09-06 18:13:57 -04:00
doc.go go.tools: add copyright messages to source files. 2013-08-27 18:49:13 -04:00
dom.go go.tools: add copyright messages to source files. 2013-08-27 18:49:13 -04:00
emit.go go.tools: add copyright messages to source files. 2013-08-27 18:49:13 -04:00
example_test.go go.tools/importer: generalize command-line syntax. 2013-09-06 18:13:57 -04:00
func.go go.tools/ssa: use correct names for Captures. 2013-09-06 09:19:34 -04:00
lift.go go.tools: add copyright messages to source files. 2013-08-27 18:49:13 -04:00
lvalue.go go.tools: add copyright messages to source files. 2013-08-27 18:49:13 -04:00
print.go go.tools: add copyright messages to source files. 2013-08-27 18:49:13 -04:00
promote.go go.tools: add copyright messages to source files. 2013-08-27 18:49:13 -04:00
sanity.go go.tools: add copyright messages to source files. 2013-08-27 18:49:13 -04:00
source_test.go go.tools/importer: generalize command-line syntax. 2013-09-06 18:13:57 -04:00
source.go go.tools: add copyright messages to source files. 2013-08-27 18:49:13 -04:00
ssa.go go.tools/importer: generalize command-line syntax. 2013-09-06 18:13:57 -04:00
stdlib_test.go go.tools/importer: generalize command-line syntax. 2013-09-06 18:13:57 -04:00
testmain.go go.tools/importer: generalize command-line syntax. 2013-09-06 18:13:57 -04:00
util.go go.tools: add copyright messages to source files. 2013-08-27 18:49:13 -04:00
visit.go go.tools/importer: generalize command-line syntax. 2013-09-06 18:13:57 -04:00