]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: add typArray, typSlice, and typDDDArray
authorJosh Bleecher Snyder <josharian@gmail.com>
Tue, 29 Mar 2016 05:57:57 +0000 (22:57 -0700)
committerJosh Bleecher Snyder <josharian@gmail.com>
Tue, 29 Mar 2016 23:48:24 +0000 (23:48 +0000)
commiteb98e515637c9447970ac1c1a2c24c1a9f0a189e
tree5848f5435ef24fbabb24ab2b363d8fd9f154109b
parentf32161daf8b14f49acc4a8e90262817e675c8309
cmd/compile: add typArray, typSlice, and typDDDArray

These are the first of several convenience
constructors for types.

They are part of type field encapsulation.
This removes most external writes to TARRAY Type and Bound fields.

substAny still directly fiddles with the .Type field.
substAny generally needs access to Type internals.
It will be moved to type.go in a future CL.

bimport still directly writes the .Type field.
This is hard to change.

Also of note:

* inl.go contains an (apparently irrelevant) bug fix:
  as.Right was given the wrong type.
  vararrtype was previously unused.
* I believe that aindex (subr.go) never creates slices,
  but it is safer to keep existing behavior.
  The removal of -1 as a constant there is part
  of hiding that implementation detail.
  Future CLs will finish that job.

Passes toolstash -cmp.

Change-Id: If09bf001a874d7dba08e9ad0bcd6722860af4b91
Reviewed-on: https://go-review.googlesource.com/21249
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
src/cmd/compile/internal/gc/esc.go
src/cmd/compile/internal/gc/inl.go
src/cmd/compile/internal/gc/order.go
src/cmd/compile/internal/gc/parser.go
src/cmd/compile/internal/gc/reflect.go
src/cmd/compile/internal/gc/sinit.go
src/cmd/compile/internal/gc/subr.go
src/cmd/compile/internal/gc/type.go
src/cmd/compile/internal/gc/typecheck.go
src/cmd/compile/internal/gc/walk.go