]> Cypherpunks repositories - gostls13.git/commitdiff
[dev.regabi] cmd/compile: prepare mknode for rename of Func.body
authorRuss Cox <rsc@golang.org>
Sun, 6 Dec 2020 20:49:58 +0000 (15:49 -0500)
committerRuss Cox <rsc@golang.org>
Mon, 7 Dec 2020 20:41:37 +0000 (20:41 +0000)
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 <rsc@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
src/cmd/compile/internal/ir/mknode.go

index 2c007f93f1f4962a9dacad3f3cc3e31d64521810..978b2de5a524739737e0d6b46acba9885c4658b1 100644 (file)
@@ -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":