mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
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:
parent
2c20eda1d8
commit
b09925b31d
45 changed files with 358 additions and 851 deletions
|
|
@ -706,8 +706,7 @@ func hostlink() {
|
|||
case '8':
|
||||
argv = append(argv, "-m32")
|
||||
|
||||
case '6',
|
||||
'9':
|
||||
case '6', '9':
|
||||
argv = append(argv, "-m64")
|
||||
|
||||
case '5':
|
||||
|
|
@ -1173,10 +1172,7 @@ func stkcheck(up *Chain, depth int) int {
|
|||
r = &s.R[ri]
|
||||
switch r.Type {
|
||||
// Direct call.
|
||||
case R_CALL,
|
||||
R_CALLARM,
|
||||
R_CALLARM64,
|
||||
R_CALLPOWER:
|
||||
case R_CALL, R_CALLARM, R_CALLARM64, R_CALLPOWER:
|
||||
ch.limit = int(int32(limit) - pcsp.value - int32(callsize()))
|
||||
|
||||
ch.sym = r.Sym
|
||||
|
|
@ -1357,8 +1353,7 @@ func genasmsym(put func(*LSym, string, int, int64, int64, int, *LSym)) {
|
|||
}
|
||||
put(s, s.Name, 'D', Symaddr(s), s.Size, int(s.Version), s.Gotype)
|
||||
|
||||
case SBSS,
|
||||
SNOPTRBSS:
|
||||
case SBSS, SNOPTRBSS:
|
||||
if !s.Reachable {
|
||||
continue
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue