mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
[dev.link] cmd: add flag to mark gotype symbols
Add a flag bit to mark symbols in the new object file as containing Go type information. The use of a flag eliminates the need to do symbol name matching as part of the new dead code elimination pass, which should produce a minor speedup. Change-Id: Iec8700e1139e2c4e310644c0766379865d2d6f82 Reviewed-on: https://go-review.googlesource.com/c/go/+/201399 Run-TryBot: Than McIntosh <thanm@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Jeremy Faller <jeremy@golang.org> Reviewed-by: Cherry Zhang <cherryyz@google.com>
This commit is contained in:
parent
15634a0230
commit
8011051361
4 changed files with 11 additions and 3 deletions
|
|
@ -364,6 +364,11 @@ func (l *Loader) IsReflectMethod(i Sym) bool {
|
|||
return l.SymAttr(i)&goobj2.SymFlagReflectMethod != 0
|
||||
}
|
||||
|
||||
// Returns whether this is a Go type symbol.
|
||||
func (l *Loader) IsGoType(i Sym) bool {
|
||||
return l.SymAttr(i)&goobj2.SymFlagGoType != 0
|
||||
}
|
||||
|
||||
// Returns the symbol content of the i-th symbol. i is global index.
|
||||
func (l *Loader) Data(i Sym) []byte {
|
||||
if l.isExternal(i) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue