aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/link/internal/loader/loader.go
diff options
context:
space:
mode:
authorCherry Zhang <cherryyz@google.com>2020-04-08 19:46:00 -0400
committerCherry Zhang <cherryyz@google.com>2020-04-09 19:02:47 +0000
commita35b3227093eea2888dbf0039db7812a8bf23943 (patch)
tree7f0eb13ac02934a3f740e30b801bbaa8c8240010 /src/cmd/link/internal/loader/loader.go
parentfd7666881beb9bb598e8e4e0c2ba9cd3a9ee4466 (diff)
downloadgo-a35b3227093eea2888dbf0039db7812a8bf23943.tar.gz
go-a35b3227093eea2888dbf0039db7812a8bf23943.zip
[dev.link] cmd/link: convert typelink pass to new style
Change-Id: If861409a5cc4e398496199a89498a141f106f44f Reviewed-on: https://go-review.googlesource.com/c/go/+/227762 Run-TryBot: Cherry Zhang <cherryyz@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Than McIntosh <thanm@google.com>
Diffstat (limited to 'src/cmd/link/internal/loader/loader.go')
-rw-r--r--src/cmd/link/internal/loader/loader.go9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/cmd/link/internal/loader/loader.go b/src/cmd/link/internal/loader/loader.go
index 3437b42b65..cd5971c2e1 100644
--- a/src/cmd/link/internal/loader/loader.go
+++ b/src/cmd/link/internal/loader/loader.go
@@ -659,7 +659,9 @@ func (l *Loader) SymType(i Sym) sym.SymKind {
// Returns the attributes of the i-th symbol.
func (l *Loader) SymAttr(i Sym) uint8 {
if l.IsExternal(i) {
- // TODO: do something? External symbols have different representation of attributes. For now, ReflectMethod is the only thing matters and it cannot be set by external symbol.
+ // TODO: do something? External symbols have different representation of attributes.
+ // For now, ReflectMethod, NoSplit, GoType, and Typelink are used and they cannot be
+ // set by external symbol.
return 0
}
r, li := l.toLocal(i)
@@ -982,6 +984,11 @@ func (l *Loader) IsGoType(i Sym) bool {
return l.SymAttr(i)&goobj2.SymFlagGoType != 0
}
+// Returns whether this symbol should be included in typelink.
+func (l *Loader) IsTypelink(i Sym) bool {
+ return l.SymAttr(i)&goobj2.SymFlagTypelink != 0
+}
+
// Returns whether this is a "go.itablink.*" symbol.
func (l *Loader) IsItabLink(i Sym) bool {
if _, ok := l.itablink[i]; ok {