aboutsummaryrefslogtreecommitdiff
path: root/src/cmd
diff options
context:
space:
mode:
authorCuong Manh Le <cuong.manhle.vn@gmail.com>2022-05-13 19:04:59 +0700
committerMatthew Dempsky <mdempsky@google.com>2022-05-13 21:28:16 +0000
commit80f3e3deba619fcf0ddcb547c61c9cbbd8b81968 (patch)
tree8883a483c65160d81459c776b07d60440143efe1 /src/cmd
parent499e334a28c63c15e0b1add8172fd48b3c19e1ce (diff)
downloadgo-80f3e3deba619fcf0ddcb547c61c9cbbd8b81968.tar.xz
cmd/compile/internal/ir: remove NilExpr.Sym_
Historically, the compiler used to use a name node to represent "nil". Now, "nil" is represented by NilExpr, so it's not necessary to associate a Sym with it anymore. Passes toolstash-check. Change-Id: Ied1ddefa06ea55ada18ca52c8fcf71defa4c23b2 Reviewed-on: https://go-review.googlesource.com/c/go/+/406174 Reviewed-by: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com> Reviewed-by: Heschi Kreinick <heschi@google.com>
Diffstat (limited to 'src/cmd')
-rw-r--r--src/cmd/compile/internal/ir/expr.go4
-rw-r--r--src/cmd/compile/internal/typecheck/universe.go4
2 files changed, 1 insertions, 7 deletions
diff --git a/src/cmd/compile/internal/ir/expr.go b/src/cmd/compile/internal/ir/expr.go
index ffbeb20053..43d48b4a65 100644
--- a/src/cmd/compile/internal/ir/expr.go
+++ b/src/cmd/compile/internal/ir/expr.go
@@ -409,7 +409,6 @@ func (n *MakeExpr) SetOp(op Op) {
// (It may be copied and assigned a type, though.)
type NilExpr struct {
miniExpr
- Sym_ *types.Sym // TODO: Remove
}
func NewNilExpr(pos src.XPos) *NilExpr {
@@ -419,9 +418,6 @@ func NewNilExpr(pos src.XPos) *NilExpr {
return n
}
-func (n *NilExpr) Sym() *types.Sym { return n.Sym_ }
-func (n *NilExpr) SetSym(x *types.Sym) { n.Sym_ = x }
-
// A ParenExpr is a parenthesized expression (X).
// It may end up being a value or a type.
type ParenExpr struct {
diff --git a/src/cmd/compile/internal/typecheck/universe.go b/src/cmd/compile/internal/typecheck/universe.go
index a49bf5793e..19cb244d58 100644
--- a/src/cmd/compile/internal/typecheck/universe.go
+++ b/src/cmd/compile/internal/typecheck/universe.go
@@ -101,9 +101,7 @@ func InitUniverse() {
ir.AsNode(s.Def).SetType(types.Types[types.TBLANK])
s = types.BuiltinPkg.Lookup("nil")
- nnil := NodNil()
- nnil.(*ir.NilExpr).SetSym(s)
- s.Def = nnil
+ s.Def = NodNil()
// initialize okfor
for et := types.Kind(0); et < types.NTYPE; et++ {