diff options
author | Matthew Dempsky <mdempsky@google.com> | 2021-01-17 00:30:32 -0800 |
---|---|---|
committer | Matthew Dempsky <mdempsky@google.com> | 2021-01-17 11:14:51 +0000 |
commit | 87845d14f9822c104cc192c8f7858a2a24d0029f (patch) | |
tree | 9b6f10de2e76159f7027fe419eb3f4cb75390908 /src/cmd/compile/internal/typecheck/typecheck.go | |
parent | e3027c6828230d01089afec0ab958040ba326abc (diff) | |
download | go-87845d14f9822c104cc192c8f7858a2a24d0029f.tar.gz go-87845d14f9822c104cc192c8f7858a2a24d0029f.zip |
[dev.regabi] cmd/compile: add ir.TailCallStmt
This CL splits out ORETJMP as a new TailCallStmt node, separate from
the other BranchStmt nodes. In doing so, this allows us to change it
from identifying a function by *types.Sym to identifying one by
directly pointing to the *ir.Func.
While here, also rename the operation to OTAILCALL.
Passes toolstash -cmp.
Change-Id: I273e6ea5d92bf3005ae02fb59b3240a190a6cf1b
Reviewed-on: https://go-review.googlesource.com/c/go/+/284227
Trust: Matthew Dempsky <mdempsky@google.com>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Diffstat (limited to 'src/cmd/compile/internal/typecheck/typecheck.go')
-rw-r--r-- | src/cmd/compile/internal/typecheck/typecheck.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/cmd/compile/internal/typecheck/typecheck.go b/src/cmd/compile/internal/typecheck/typecheck.go index 5b44a5743f..7881ea308d 100644 --- a/src/cmd/compile/internal/typecheck/typecheck.go +++ b/src/cmd/compile/internal/typecheck/typecheck.go @@ -857,8 +857,8 @@ func typecheck1(n ir.Node, top int) ir.Node { n := n.(*ir.ReturnStmt) return tcReturn(n) - case ir.ORETJMP: - n := n.(*ir.BranchStmt) + case ir.OTAILCALL: + n := n.(*ir.TailCallStmt) return n case ir.OSELECT: @@ -2023,7 +2023,7 @@ func isTermNode(n ir.Node) bool { n := n.(*ir.BlockStmt) return isTermNodes(n.List) - case ir.OGOTO, ir.ORETURN, ir.ORETJMP, ir.OPANIC, ir.OFALL: + case ir.OGOTO, ir.ORETURN, ir.OTAILCALL, ir.OPANIC, ir.OFALL: return true case ir.OFOR, ir.OFORUNTIL: |