aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/test
diff options
context:
space:
mode:
authorMatthew Dempsky <mdempsky@google.com>2023-08-18 00:09:06 -0700
committerGopher Robot <gobot@golang.org>2023-08-18 22:41:47 +0000
commit7af28fa90ec2ce4c90ca47b6bc3e348ac8cb133a (patch)
treedc41f3af7b62c7dcc73791e43fe5a09fb39550ac /src/cmd/compile/internal/test
parent4089b6a5b13282a2fd3d1ec5b1a2d67825c5e6b2 (diff)
downloadgo-7af28fa90ec2ce4c90ca47b6bc3e348ac8cb133a.tar.xz
cmd/compile/internal/ir: remove AsNode
Except for a single call site in escape analysis, every use of ir.AsNode involves a types.Object that's known to contain an *ir.Name. Asserting directly to that type makes the code simpler and more efficient. The one use in escape analysis is extended to handle nil correctly without it. Change-Id: I694ae516903e541341d82c2f65a9155e4b0a9809 Reviewed-on: https://go-review.googlesource.com/c/go/+/520775 TryBot-Bypass: Matthew Dempsky <mdempsky@google.com> Run-TryBot: Matthew Dempsky <mdempsky@google.com> Auto-Submit: Matthew Dempsky <mdempsky@google.com> Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Diffstat (limited to 'src/cmd/compile/internal/test')
-rw-r--r--src/cmd/compile/internal/test/abiutilsaux_test.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cmd/compile/internal/test/abiutilsaux_test.go b/src/cmd/compile/internal/test/abiutilsaux_test.go
index 3316af6940..7f929c603d 100644
--- a/src/cmd/compile/internal/test/abiutilsaux_test.go
+++ b/src/cmd/compile/internal/test/abiutilsaux_test.go
@@ -76,7 +76,7 @@ func tokenize(src string) []string {
}
func verifyParamResultOffset(t *testing.T, f *types.Field, r abi.ABIParamAssignment, which string, idx int) int {
- n := ir.AsNode(f.Nname).(*ir.Name)
+ n := f.Nname.(*ir.Name)
if n.FrameOffset() != int64(r.Offset()) {
t.Errorf("%s %d: got offset %d wanted %d t=%v",
which, idx, r.Offset(), n.Offset_, f.Type)