1
0
mirror of https://github.com/golang/go synced 2024-11-24 21:50:11 -07:00
go/src
David Crawshaw cc158403d6 cmd/compile: track reflect.Type.Method in deadcode
In addition to reflect.Value.Call, exported methods can be invoked
by the Func value in the reflect.Method struct. This CL has the
compiler track what functions get access to a legitimate reflect.Method
struct by looking for interface calls to either of:

	Method(int) reflect.Method
	MethodByName(string) (reflect.Method, bool)

This is a little overly conservative. If a user implements a type
with one of these methods without using the underlying calls on
reflect.Type, the linker will assume the worst and include all
exported methods. But it's cheap.

No change to any of the binary sizes reported in cl/20483.

For #14740

Change-Id: Ie17786395d0453ce0384d8b240ecb043b7726137
Reviewed-on: https://go-review.googlesource.com/20489
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2016-03-11 21:19:20 +00:00
..
archive
bufio
builtin
bytes bytes: correct comment about usage of bytes.Buffer by Printf 2016-03-10 15:54:08 +00:00
cmd cmd/compile: track reflect.Type.Method in deadcode 2016-03-11 21:19:20 +00:00
compress compress/flate: optimize huffman bit encoder 2016-03-11 17:40:52 +00:00
container
crypto crypto/x509/pkix: make 'v1' the default CRL version. 2016-03-10 23:48:16 +00:00
database/sql
debug
encoding
errors
expvar
flag
fmt fmt: refactor pointer formatting and improve tests 2016-03-09 20:59:50 +00:00
go testing: implement 'Unordered Output' in Examples. 2016-03-09 04:34:41 +00:00
hash hash/crc32: use slicing by 8 for Castagnoli and smaller sizes 2016-03-08 16:46:24 +00:00
html
image
index/suffixarray
internal
io
log
math math: improve sqrt for ppc64le,ppc64 2016-03-10 15:01:21 +00:00
mime mime/multipart: don't call Read on io.Reader after an error is seen 2016-03-07 19:50:16 +00:00
net net/http: defer idleMu.Unlock() in tryPutIdleConn + minor typo fixes. 2016-03-11 06:12:28 +00:00
os os/user: make OS-specific getgrouplist calls 2016-03-08 20:58:00 +00:00
path
reflect cmd/compile: remove slices from rtype.funcType 2016-03-09 01:25:18 +00:00
regexp
runtime cmd/compile: track reflect.Type.Method in deadcode 2016-03-11 21:19:20 +00:00
sort
strconv
strings
sync
syscall syscall: add NO_LOCAL_POINTERS to syscall.exit in plan9_arm 2016-03-09 16:32:02 +00:00
testing testing: implement 'Unordered Output' in Examples. 2016-03-09 04:34:41 +00:00
text
time
unicode
unsafe
vendor
all.bash
all.bat
all.rc
androidtest.bash
bootstrap.bash
buildall.bash
clean.bash
clean.bat
clean.rc
iostest.bash
make.bash
make.bat
Make.dist
make.rc
nacltest.bash
race.bash
race.bat
run.bash
run.bat
run.rc