• David Crawshaw's avatar
    cmd/compile: track reflect.Type.Method in deadcode · cc158403
    David Crawshaw authored
    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/20489Reviewed-by: 's avatarMatthew Dempsky <mdempsky@google.com>
    cc158403
Name
Last commit
Last update
.github Loading commit data...
api Loading commit data...
doc Loading commit data...
lib/time Loading commit data...
misc Loading commit data...
src Loading commit data...
test Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
AUTHORS Loading commit data...
CONTRIBUTING.md Loading commit data...
CONTRIBUTORS Loading commit data...
LICENSE Loading commit data...
PATENTS Loading commit data...
README.md Loading commit data...
favicon.ico Loading commit data...
robots.txt Loading commit data...