cmd/compile/internal/ir: remove OrigNode

The OrigNode functionality used to be relevant to the typecheck
frontend, because we wanted to report errors using the same syntax as
the user originally wrote. However, now that types2 handles all
spec-required error diagnostics, there's no need to preserve original
nodes anymore.

Change-Id: I64a0540b8952513913021e7b84d165beb1f9f801
Reviewed-on: https://go-review.googlesource.com/c/go/+/526397
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Auto-Submit: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
This commit is contained in:
Matthew Dempsky 2023-09-06 16:05:11 -07:00 committed by Gopher Robot
parent 0a49d4a778
commit d2eab5ff19
5 changed files with 8 additions and 67 deletions

View file

@ -188,7 +188,6 @@ func (n *BinaryExpr) SetOp(op Op) {
// A CallExpr is a function call X(Args).
type CallExpr struct {
miniExpr
origNode
X Node
Args Nodes
RType Node `mknode:"-"` // see reflectdata/helpers.go
@ -200,7 +199,6 @@ type CallExpr struct {
func NewCallExpr(pos src.XPos, op Op, fun Node, args []Node) *CallExpr {
n := &CallExpr{X: fun}
n.pos = pos
n.orig = n
n.SetOp(op)
n.Args = args
return n
@ -234,7 +232,6 @@ type ClosureExpr struct {
// Before type-checking, the type is Ntype.
type CompLitExpr struct {
miniExpr
origNode
List Nodes // initialized values
RType Node `mknode:"-"` // *runtime._type for OMAPLIT map types
Prealloc *Name
@ -251,7 +248,6 @@ func NewCompLitExpr(pos src.XPos, op Op, typ *types.Type, list []Node) *CompLitE
if typ != nil {
n.SetType(typ)
}
n.orig = n
return n
}