aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/ssa/stackalloc.go
diff options
context:
space:
mode:
authorapocelipes <seve3r@outlook.com>2025-04-17 07:49:35 +0000
committerGopher Robot <gobot@golang.org>2025-04-18 04:21:12 -0700
commit8a8efafa8835b646955dd46f4f466d3126e56200 (patch)
tree8e289a65b22c8fbf9c98cbbfa7b4321f0162b304 /src/cmd/compile/internal/ssa/stackalloc.go
parentb89988c5ca47a6a2022db689fa882134397d0f32 (diff)
downloadgo-8a8efafa8835b646955dd46f4f466d3126e56200.tar.xz
cmd/compile: use the builtin clear
To simplify the code a bit. Change-Id: Ia72f576de59ff161ec389a4992bb635f89783540 GitHub-Last-Rev: eaec8216be964418a085649fcca53a042f28ce1a GitHub-Pull-Request: golang/go#73411 Reviewed-on: https://go-review.googlesource.com/c/go/+/666117 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Auto-Submit: Keith Randall <khr@golang.org> Reviewed-by: Michael Pratt <mpratt@google.com> Reviewed-by: Keith Randall <khr@google.com> Reviewed-by: Keith Randall <khr@golang.org>
Diffstat (limited to 'src/cmd/compile/internal/ssa/stackalloc.go')
-rw-r--r--src/cmd/compile/internal/ssa/stackalloc.go12
1 files changed, 3 insertions, 9 deletions
diff --git a/src/cmd/compile/internal/ssa/stackalloc.go b/src/cmd/compile/internal/ssa/stackalloc.go
index 8290e1730e..11ffe5b55e 100644
--- a/src/cmd/compile/internal/ssa/stackalloc.go
+++ b/src/cmd/compile/internal/ssa/stackalloc.go
@@ -46,15 +46,9 @@ func newStackAllocState(f *Func) *stackAllocState {
}
func putStackAllocState(s *stackAllocState) {
- for i := range s.values {
- s.values[i] = stackValState{}
- }
- for i := range s.interfere {
- s.interfere[i] = nil
- }
- for i := range s.names {
- s.names[i] = LocalSlot{}
- }
+ clear(s.values)
+ clear(s.interfere)
+ clear(s.names)
s.f.Cache.stackAllocState = s
s.f = nil
s.live = nil