diff options
author | Matthew Dempsky <mdempsky@google.com> | 2020-12-26 18:02:33 -0800 |
---|---|---|
committer | Matthew Dempsky <mdempsky@google.com> | 2020-12-28 03:39:08 +0000 |
commit | 0de8eafd98e7431a46c60dd8ea4d3f3a47691049 (patch) | |
tree | 6bb37ff70c6154412dc40c23fceea0f4a40e9bc9 /src/cmd/compile/internal/typecheck/typecheck.go | |
parent | a4f335f42033bc1ef9b948a9bff6f14aa6eb1aa8 (diff) | |
download | go-0de8eafd98e7431a46c60dd8ea4d3f3a47691049.tar.gz go-0de8eafd98e7431a46c60dd8ea4d3f3a47691049.zip |
[dev.regabi] cmd/compile: remove SelectorExpr.Offset field
Now that the previous CL ensures we always set SelectorExpr.Selection,
we can replace the SelectorExpr.Offset field with a helper method that
simply returns SelectorExpr.Selection.Offset.
Passes toolstash -cmp.
Change-Id: Id0f22b8b1980397b668f6860d27cb197b90ff52a
Reviewed-on: https://go-review.googlesource.com/c/go/+/280433
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, 2 insertions, 4 deletions
diff --git a/src/cmd/compile/internal/typecheck/typecheck.go b/src/cmd/compile/internal/typecheck/typecheck.go index 05a346b8c8..1d070507fa 100644 --- a/src/cmd/compile/internal/typecheck/typecheck.go +++ b/src/cmd/compile/internal/typecheck/typecheck.go @@ -1232,7 +1232,7 @@ func lookdot(n *ir.SelectorExpr, t *types.Type, dostrcmp int) *types.Field { if f1.Offset == types.BADWIDTH { base.Fatalf("lookdot badwidth %v %p", f1, f1) } - n.Offset = f1.Offset + n.Selection = f1 n.SetType(f1.Type) if t.IsInterface() { if n.X.Type().IsPtr() { @@ -1243,7 +1243,6 @@ func lookdot(n *ir.SelectorExpr, t *types.Type, dostrcmp int) *types.Field { n.SetOp(ir.ODOTINTER) } - n.Selection = f1 return f1 } @@ -1299,10 +1298,9 @@ func lookdot(n *ir.SelectorExpr, t *types.Type, dostrcmp int) *types.Field { } n.Sel = ir.MethodSym(n.X.Type(), f2.Sym) - n.Offset = f2.Offset + n.Selection = f2 n.SetType(f2.Type) n.SetOp(ir.ODOTMETH) - n.Selection = f2 return f2 } |