Commit 5280dfbf authored by Matthew Dempsky's avatar Matthew Dempsky

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: default avatarBrad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
parent 716219ff
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment