]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile/internal/walk: relocate a stray comment
authorThan McIntosh <thanm@google.com>
Thu, 18 Mar 2021 15:18:44 +0000 (11:18 -0400)
committerThan McIntosh <thanm@google.com>
Mon, 22 Mar 2021 20:20:58 +0000 (20:20 +0000)
The explanatory comment and the associated version counter variable
for the helper routine "wrapCall" seem to have been left behind in
walk.go during the big refactoring -- move it back to where it should
be, next to wrapCall in stmt.go. Also fix a small buglet in the
comment itself.

Change-Id: I8637a838214b216581be59e01149a72282a46526
Reviewed-on: https://go-review.googlesource.com/c/go/+/303729
Trust: Than McIntosh <thanm@google.com>
Run-TryBot: Than McIntosh <thanm@google.com>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
src/cmd/compile/internal/walk/stmt.go
src/cmd/compile/internal/walk/walk.go

index 0c851506cbe8e3aa6e60c9c099d25fa6b42e46e7..836ac6b6abd2465043692d6a617bc32c0b441d1f 100644 (file)
@@ -233,6 +233,24 @@ func walkIf(n *ir.IfStmt) ir.Node {
        return n
 }
 
+// Rewrite
+//     go builtin(x, y, z)
+// into
+//     go func(a1, a2, a3) {
+//             builtin(a1, a2, a3)
+//     }(x, y, z)
+// for print, println, and delete.
+//
+// Rewrite
+//     go f(x, y, uintptr(unsafe.Pointer(z)))
+// into
+//     go func(a1, a2, a3) {
+//             f(a1, a2, uintptr(a3))
+//     }(x, y, unsafe.Pointer(z))
+// for function contains unsafe-uintptr arguments.
+
+var wrapCall_prgen int
+
 // The result of wrapCall MUST be assigned back to n, e.g.
 //     n.Left = wrapCall(n.Left, init)
 func wrapCall(n *ir.CallExpr, init *ir.Nodes) ir.Node {
index b47d96dc4c933db6022f9bffc20334b69313edba..d889786c7286a2f5e94990b186ab0572adf34ec5 100644 (file)
@@ -237,24 +237,6 @@ func walkAppendArgs(n *ir.CallExpr, init *ir.Nodes) {
        }
 }
 
-// Rewrite
-//     go builtin(x, y, z)
-// into
-//     go func(a1, a2, a3) {
-//             builtin(a1, a2, a3)
-//     }(x, y, z)
-// for print, println, and delete.
-//
-// Rewrite
-//     go f(x, y, uintptr(unsafe.Pointer(z)))
-// into
-//     go func(a1, a2, a3) {
-//             builtin(a1, a2, uintptr(a3))
-//     }(x, y, unsafe.Pointer(z))
-// for function contains unsafe-uintptr arguments.
-
-var wrapCall_prgen int
-
 // appendWalkStmt typechecks and walks stmt and then appends it to init.
 func appendWalkStmt(init *ir.Nodes, stmt ir.Node) {
        op := stmt.Op()