// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build gen
// +build gen
// This program generates Go code that applies rewrite rules to a Value.
swc.add(stmtf("return rewriteValue%s%s_%s(v)", arch.name, suff, op))
sw.add(swc)
}
- fn.add(sw)
+ if len(sw.List) > 0 { // skip if empty
+ fn.add(sw)
+ }
fn.add(stmtf("return false"))
genFile.add(fn)
}
sw.add(swc)
}
- fn.add(sw)
+ if len(sw.List) > 0 { // skip if empty
+ fn.add(sw)
+ }
fn.add(stmtf("return false"))
genFile.add(fn)