cmd/compile: clean up methodsym

Convert yyerrors into Fatals.
Remove the goto.
Move variable declaration closer to use.
Unify printing strings a bit.
Convert an int param into a bool.

Passes toolstash-check. No compiler performance impact.

Change-Id: I9017681417b785cf8693d18b124ac4f1ff37f2b5
Reviewed-on: https://go-review.googlesource.com/39170
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
Josh Bleecher Snyder 2017-03-31 09:57:38 -07:00
parent 3237af2da8
commit 2f072a427a
4 changed files with 27 additions and 41 deletions

View file

@ -356,8 +356,8 @@ func methods(t *Type) []*Sig {
sig.pkg = method.Pkg
}
sig.isym = methodsym(method, it, 1)
sig.tsym = methodsym(method, t, 0)
sig.isym = methodsym(method, it, true)
sig.tsym = methodsym(method, t, false)
sig.type_ = methodfunc(f.Type, t)
sig.mtype = methodfunc(f.Type, nil)
@ -423,7 +423,7 @@ func imethods(t *Type) []*Sig {
// IfaceType.Method is not in the reflect data.
// Generate the method body, so that compiled
// code can refer to it.
isym := methodsym(method, t, 0)
isym := methodsym(method, t, false)
if !isym.Siggen() {
isym.SetSiggen(true)
genwrapper(t, f, isym, 0)