From 7af28fa90ec2ce4c90ca47b6bc3e348ac8cb133a Mon Sep 17 00:00:00 2001 From: Matthew Dempsky Date: Fri, 18 Aug 2023 00:09:06 -0700 Subject: 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 Run-TryBot: Matthew Dempsky Auto-Submit: Matthew Dempsky Reviewed-by: Cuong Manh Le Reviewed-by: Dmitri Shuralyov --- src/cmd/compile/internal/test/abiutilsaux_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/cmd/compile/internal/test') 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) -- cgit v1.3