mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/compile: make no-op rewrite funcs smaller
This doesn't change any behavior, but should help the compiler realise that these funcs really do nothing at all. Change-Id: Ib26c02ef264691acac983538ec300f91d6ff98db Reviewed-on: https://go-review.googlesource.com/c/go/+/280314 Trust: Daniel Martí <mvdan@mvdan.cc> Run-TryBot: Daniel Martí <mvdan@mvdan.cc> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Keith Randall <khr@golang.org>
This commit is contained in:
parent
e838c76a6e
commit
bd8b3fe5be
6 changed files with 7 additions and 12 deletions
|
|
@ -2,6 +2,7 @@
|
||||||
// Use of this source code is governed by a BSD-style
|
// Use of this source code is governed by a BSD-style
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
//go:build gen
|
||||||
// +build gen
|
// +build gen
|
||||||
|
|
||||||
// This program generates Go code that applies rewrite rules to a Value.
|
// This program generates Go code that applies rewrite rules to a Value.
|
||||||
|
|
@ -194,7 +195,9 @@ func genRulesSuffix(arch arch, suff string) {
|
||||||
swc.add(stmtf("return rewriteValue%s%s_%s(v)", arch.name, suff, op))
|
swc.add(stmtf("return rewriteValue%s%s_%s(v)", arch.name, suff, op))
|
||||||
sw.add(swc)
|
sw.add(swc)
|
||||||
}
|
}
|
||||||
fn.add(sw)
|
if len(sw.List) > 0 { // skip if empty
|
||||||
|
fn.add(sw)
|
||||||
|
}
|
||||||
fn.add(stmtf("return false"))
|
fn.add(stmtf("return false"))
|
||||||
genFile.add(fn)
|
genFile.add(fn)
|
||||||
|
|
||||||
|
|
@ -264,7 +267,9 @@ func genRulesSuffix(arch arch, suff string) {
|
||||||
}
|
}
|
||||||
sw.add(swc)
|
sw.add(swc)
|
||||||
}
|
}
|
||||||
fn.add(sw)
|
if len(sw.List) > 0 { // skip if empty
|
||||||
|
fn.add(sw)
|
||||||
|
}
|
||||||
fn.add(stmtf("return false"))
|
fn.add(stmtf("return false"))
|
||||||
genFile.add(fn)
|
genFile.add(fn)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -156,7 +156,5 @@ func rewriteValue386splitload_Op386CMPWload(v *Value) bool {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
func rewriteBlock386splitload(b *Block) bool {
|
func rewriteBlock386splitload(b *Block) bool {
|
||||||
switch b.Kind {
|
|
||||||
}
|
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -847,7 +847,5 @@ func rewriteValueAMD64splitload_OpAMD64CMPWloadidx2(v *Value) bool {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
func rewriteBlockAMD64splitload(b *Block) bool {
|
func rewriteBlockAMD64splitload(b *Block) bool {
|
||||||
switch b.Kind {
|
|
||||||
}
|
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4902,7 +4902,5 @@ func rewriteValueWasm_OpZeroExt8to64(v *Value) bool {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
func rewriteBlockWasm(b *Block) bool {
|
func rewriteBlockWasm(b *Block) bool {
|
||||||
switch b.Kind {
|
|
||||||
}
|
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -409,7 +409,5 @@ func rewriteValuedec_OpStringPtr(v *Value) bool {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
func rewriteBlockdec(b *Block) bool {
|
func rewriteBlockdec(b *Block) bool {
|
||||||
switch b.Kind {
|
|
||||||
}
|
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2458,7 +2458,5 @@ func rewriteValuedec64_OpZeroExt8to64(v *Value) bool {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
func rewriteBlockdec64(b *Block) bool {
|
func rewriteBlockdec64(b *Block) bool {
|
||||||
switch b.Kind {
|
|
||||||
}
|
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue