mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/compile/internal/types: eliminate FieldName
This functionality can be implemented in package types without a trampoline back to gc. Change-Id: Iaff7169fece35482e654553bf16b07dc67d1991a Reviewed-on: https://go-review.googlesource.com/41416 Run-TryBot: Matthew Dempsky <mdempsky@google.com> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
parent
716219ffd9
commit
5280dfbfad
3 changed files with 1 additions and 5 deletions
|
|
@ -386,9 +386,6 @@ func Main(archInit func(*Arch)) {
|
|||
types.FormatType = func(t *types.Type, s fmt.State, verb rune, mode int) {
|
||||
typeFormat(t, s, verb, fmtMode(mode))
|
||||
}
|
||||
types.FieldName = func(f *types.Field) string {
|
||||
return f.Sym.Name
|
||||
}
|
||||
types.TypeLinkSym = func(t *types.Type) *obj.LSym {
|
||||
return typenamesym(t).Linksym()
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1221,7 +1221,7 @@ func (t *Type) FieldOff(i int) int64 {
|
|||
return t.Field(i).Offset
|
||||
}
|
||||
func (t *Type) FieldName(i int) string {
|
||||
return FieldName(t.Field(i))
|
||||
return t.Field(i).Sym.Name
|
||||
}
|
||||
|
||||
func (t *Type) NumElem() int64 {
|
||||
|
|
|
|||
|
|
@ -25,7 +25,6 @@ var (
|
|||
Tconv func(*Type, int, int, int) string // orig: func tconv(t *Type, flag FmtFlag, mode fmtMode, depth int) string
|
||||
FormatSym func(*Sym, fmt.State, rune, int) // orig: func symFormat(sym *Sym, s fmt.State, verb rune, mode fmtMode)
|
||||
FormatType func(*Type, fmt.State, rune, int) // orig: func typeFormat(t *Type, s fmt.State, verb rune, mode fmtMode)
|
||||
FieldName func(*Field) string
|
||||
TypeLinkSym func(*Type) *obj.LSym
|
||||
Ctxt *obj.Link
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue