]> Cypherpunks repositories - gostls13.git/commit
[dev.link] cmd/link: support reflect.Type.Method tracking in deadcode2
authorCherry Zhang <cherryyz@google.com>
Tue, 8 Oct 2019 22:21:22 +0000 (18:21 -0400)
committerCherry Zhang <cherryyz@google.com>
Mon, 14 Oct 2019 15:55:52 +0000 (15:55 +0000)
commitd6535415fb3246ac5beda22bb6e557700df628ae
treeb7674db104478aa90a6bf5dc838155433d05a931
parent7d6f79e61783a5ee86e39e47f2d85b3e21552c97
[dev.link] cmd/link: support reflect.Type.Method tracking in deadcode2

When reflect.Type.Method is called, all exported methods from a
reachable type need to be conservatively live. When such a
function is called, the compiler sets an attribute to the
function, and the linker needs to check that attribute. Implement
this in the index-based deadcode pass.

Unify symbol flags and FuncInfo flags to make things simpler. In
particular, the deadcode pass can check the reflectMethod
attribute without reading in and decoding FuncInfo.

Change-Id: Ibb21e172f2996e899c6efa5551a29d0eca62df67
Reviewed-on: https://go-review.googlesource.com/c/go/+/200099
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
src/cmd/internal/goobj/readnew.go
src/cmd/internal/goobj2/funcinfo.go
src/cmd/internal/goobj2/objfile.go
src/cmd/internal/obj/objfile2.go
src/cmd/link/internal/ld/deadcode2.go
src/cmd/link/internal/objfile/objfile2.go