mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/compile: add clear(x) builtin
To clear map, and zero content of slice. Updates #56351 Change-Id: I5f81dfbc465500f5acadaf2c6beb9b5f0d2c4045 Reviewed-on: https://go-review.googlesource.com/c/go/+/453395 Reviewed-by: Cherry Mui <cherryyz@google.com> Reviewed-by: Keith Randall <khr@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Keith Randall <khr@google.com> Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com> Auto-Submit: Cuong Manh Le <cuong.manhle.vn@gmail.com>
This commit is contained in:
parent
bb4ea80bef
commit
b89a840d65
17 changed files with 256 additions and 142 deletions
|
|
@ -39,6 +39,7 @@ func walkStmt(n ir.Node) ir.Node {
|
|||
ir.OAS2RECV,
|
||||
ir.OAS2FUNC,
|
||||
ir.OAS2MAPR,
|
||||
ir.OCLEAR,
|
||||
ir.OCLOSE,
|
||||
ir.OCOPY,
|
||||
ir.OCALLINTER,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue