]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: add transform functions for OXDOT and builtins
authorDan Scales <danscales@google.com>
Wed, 24 Mar 2021 21:50:02 +0000 (14:50 -0700)
committerDan Scales <danscales@google.com>
Thu, 25 Mar 2021 23:23:10 +0000 (23:23 +0000)
commitb587b050ca55661120912b5a1d6071a1922ad0ea
treebeec6285bd589315d1e82755b8bd5472c4c84371
parent374b1904750931ed09d342e3c4c6e01fdb2802aa
cmd/compile: add transform functions for OXDOT and builtins

Pull out the tranformation part of the typechecking functions for:
 - selector expressions (OXDOT)
 - calls to builtin functions (which go through the typechecker loop
   twice, once for the call and once for each different kind of
   builtin).

Some of the transformation functions create new nodes that should have
the same type as the original node. For consistency, now each of the
transformation functions requires that the node passed in has its type
and typecheck flag set. If the transformation function replaces or adds
new nodes, it will set the type and typecheck flag for those new nodes.

As usual, passes all the gotests, even with -G=3 enabled.

Change-Id: Ic48b0ce5f58425f4a358afa78315bfc7c28066c4
Reviewed-on: https://go-review.googlesource.com/c/go/+/304729
Trust: Dan Scales <danscales@google.com>
Trust: Robert Griesemer <gri@golang.org>
Run-TryBot: Dan Scales <danscales@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
src/cmd/compile/internal/noder/helpers.go
src/cmd/compile/internal/noder/stencil.go
src/cmd/compile/internal/noder/transform.go
src/cmd/compile/internal/typecheck/expr.go
src/cmd/compile/internal/typecheck/typecheck.go