]> Cypherpunks.ru repositories - gostls13.git/commit
[dev.regabi] cmd/compile: rewrite Aux uses of ir.Node to *ir.Name [generated]
authorMatthew Dempsky <mdempsky@google.com>
Mon, 7 Dec 2020 02:13:43 +0000 (18:13 -0800)
committerMatthew Dempsky <mdempsky@google.com>
Tue, 8 Dec 2020 01:46:57 +0000 (01:46 +0000)
commit6db970e20acd7caeed268fdff458609570f21c90
tree08ef0fd6bc8586b86ca96be6b7afd106bbd1e4ab
parent1c8943a6add218f6ffd86c0952372fe54b0672a4
[dev.regabi] cmd/compile: rewrite Aux uses of ir.Node to *ir.Name [generated]

Now that the only remaining ir.Node implementation that is stored
(directly) into ssa.Aux, we can rewrite all of the conversions between
ir.Node and ssa.Aux to use *ir.Name instead.

rf doesn't have a way to rewrite the type switch case clauses, so we
just use sed instead. There's only a handful, and they're the only
times that "case ir.Node" appears anyway.

The next CL will move the tag method declarations so that ir.Node no
longer implements ssa.Aux.

Passes buildall w/ toolstash -cmp.

Updates #42982.

[git-generate]
cd src/cmd/compile/internal
sed -i -e 's/case ir.Node/case *ir.Name/' gc/plive.go */ssa.go

cd ssa
rf '
ex . ../gc {
  import "cmd/compile/internal/ir"

  var v *Value
  v.Aux.(ir.Node) -> v.Aux.(*ir.Name)

  var n ir.Node
  var asAux func(Aux)
  strict n        # only match ir.Node-typed expressions; not *ir.Name
  implicit asAux  # match implicit assignments to ssa.Aux
  asAux(n)        -> n.(*ir.Name)
}
'

Change-Id: I3206ef5f12a7cfa37c5fecc67a1ca02ea4d52b32
Reviewed-on: https://go-review.googlesource.com/c/go/+/275789
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Trust: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
13 files changed:
src/cmd/compile/internal/arm/ssa.go
src/cmd/compile/internal/arm64/ssa.go
src/cmd/compile/internal/gc/pgen.go
src/cmd/compile/internal/gc/plive.go
src/cmd/compile/internal/gc/ssa.go
src/cmd/compile/internal/mips/ssa.go
src/cmd/compile/internal/mips64/ssa.go
src/cmd/compile/internal/riscv64/ssa.go
src/cmd/compile/internal/ssa/deadstore.go
src/cmd/compile/internal/ssa/debug.go
src/cmd/compile/internal/ssa/nilcheck.go
src/cmd/compile/internal/ssa/regalloc.go
src/cmd/compile/internal/wasm/ssa.go