cmd/5g etc: merge simple case expressions onto fewer lines

The c2go translation left a lot of case expressions on separate lines.
Merge expressions onto single lines subject to these constraints:

* Max 4 clauses, all literals or names
* Don't move expressions with comments

The change was created by running http://play.golang.org/p/yHajs72h-g:

$ mergecase cmd/internal/{ld,gc,obj}/*.go cmd/internal/obj/*/*.go

Passes toolstash -cmp.

Change-Id: Iba41b390d302e5486e5dc6ba7599a92270676556
Reviewed-on: https://go-review.googlesource.com/7593
Reviewed-by: Russ Cox <rsc@golang.org>
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
This commit is contained in:
Josh Bleecher Snyder 2015-04-01 09:38:44 -07:00
parent 2c20eda1d8
commit b09925b31d
45 changed files with 358 additions and 851 deletions

View file

@ -1557,10 +1557,7 @@ func defdwsymb(sym *LSym, s string, t int, v int64, size int64, ver int, gotype
default:
return
case 'd',
'b',
'D',
'B':
case 'd', 'b', 'D', 'B':
dv = newdie(&dwglobals, DW_ABRV_VARIABLE, s)
newabslocexprattr(dv, v, sym)
if ver == 0 {
@ -1569,8 +1566,7 @@ func defdwsymb(sym *LSym, s string, t int, v int64, size int64, ver int, gotype
fallthrough
// fallthrough
case 'a',
'p':
case 'a', 'p':
dt = defgotype(gotype)
}
@ -2054,8 +2050,7 @@ func writeinfo() {
*/
func ispubname(die *DWDie) bool {
switch die.abbrev {
case DW_ABRV_FUNCTION,
DW_ABRV_VARIABLE:
case DW_ABRV_FUNCTION, DW_ABRV_VARIABLE:
a := getattr(die, DW_AT_external)
return a != nil && a.value != 0
}