From: Russ Cox Date: Sun, 6 Dec 2020 20:49:58 +0000 (-0500) Subject: [dev.regabi] cmd/compile: prepare mknode for rename of Func.body X-Git-Tag: go1.17beta1~1539^2~346 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=2de0af3b1b;p=gostls13.git [dev.regabi] cmd/compile: prepare mknode for rename of Func.body The next CL will rename Func.body to Func.Body_. At some point in the future we will rename it to Func.Body. Make the generator not get confused. Passes buildall w/ toolstash -cmp. Change-Id: Iee3f4915889a8287377bf3304d5b9250a909477e Reviewed-on: https://go-review.googlesource.com/c/go/+/275783 Trust: Russ Cox Reviewed-by: Matthew Dempsky --- diff --git a/src/cmd/compile/internal/ir/mknode.go b/src/cmd/compile/internal/ir/mknode.go index 2c007f93f1..978b2de5a5 100644 --- a/src/cmd/compile/internal/ir/mknode.go +++ b/src/cmd/compile/internal/ir/mknode.go @@ -141,7 +141,7 @@ func forNodeFields(typName string, typ *types.Struct, f func(name string, is fun } switch typName { case "Func": - if v.Name() != "body" { + if strings.ToLower(strings.TrimSuffix(v.Name(), "_")) != "body" { continue } case "Name", "Pack":