Commit ce469fad authored by Matthew Dempsky's avatar Matthew Dempsky

cmd/5g, cmd/internal/ld, cmd/internal/obj: destutter composite literals

While here, this changes DWAbbrev's attr field from a [30]DWAttrForm
with zero-termination to a simple []DWAttrForm, and updates its users
accordingly.

Passes "go build -toolexec 'toolstash -cmp' -a std" on linux/amd64.

Change-Id: I52b5f7a749bdb3e7588fc8ebdb8fee2cf8cab602
Reviewed-on: https://go-review.googlesource.com/8762
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: default avatarJosh Bleecher Snyder <josharian@gmail.com>
Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
Reviewed-by: default avatarDave Cheney <dave@cheney.net>
parent 985461fd
...@@ -1508,102 +1508,22 @@ var predinfo = []struct { ...@@ -1508,102 +1508,22 @@ var predinfo = []struct {
scond int scond int
notscond int notscond int
}{ }{
struct { {arm.ABEQ, arm.ABNE, 0x0, 0x1},
opcode int {arm.ABNE, arm.ABEQ, 0x1, 0x0},
notopcode int {arm.ABCS, arm.ABCC, 0x2, 0x3},
scond int {arm.ABHS, arm.ABLO, 0x2, 0x3},
notscond int {arm.ABCC, arm.ABCS, 0x3, 0x2},
}{arm.ABEQ, arm.ABNE, 0x0, 0x1}, {arm.ABLO, arm.ABHS, 0x3, 0x2},
struct { {arm.ABMI, arm.ABPL, 0x4, 0x5},
opcode int {arm.ABPL, arm.ABMI, 0x5, 0x4},
notopcode int {arm.ABVS, arm.ABVC, 0x6, 0x7},
scond int {arm.ABVC, arm.ABVS, 0x7, 0x6},
notscond int {arm.ABHI, arm.ABLS, 0x8, 0x9},
}{arm.ABNE, arm.ABEQ, 0x1, 0x0}, {arm.ABLS, arm.ABHI, 0x9, 0x8},
struct { {arm.ABGE, arm.ABLT, 0xA, 0xB},
opcode int {arm.ABLT, arm.ABGE, 0xB, 0xA},
notopcode int {arm.ABGT, arm.ABLE, 0xC, 0xD},
scond int {arm.ABLE, arm.ABGT, 0xD, 0xC},
notscond int
}{arm.ABCS, arm.ABCC, 0x2, 0x3},
struct {
opcode int
notopcode int
scond int
notscond int
}{arm.ABHS, arm.ABLO, 0x2, 0x3},
struct {
opcode int
notopcode int
scond int
notscond int
}{arm.ABCC, arm.ABCS, 0x3, 0x2},
struct {
opcode int
notopcode int
scond int
notscond int
}{arm.ABLO, arm.ABHS, 0x3, 0x2},
struct {
opcode int
notopcode int
scond int
notscond int
}{arm.ABMI, arm.ABPL, 0x4, 0x5},
struct {
opcode int
notopcode int
scond int
notscond int
}{arm.ABPL, arm.ABMI, 0x5, 0x4},
struct {
opcode int
notopcode int
scond int
notscond int
}{arm.ABVS, arm.ABVC, 0x6, 0x7},
struct {
opcode int
notopcode int
scond int
notscond int
}{arm.ABVC, arm.ABVS, 0x7, 0x6},
struct {
opcode int
notopcode int
scond int
notscond int
}{arm.ABHI, arm.ABLS, 0x8, 0x9},
struct {
opcode int
notopcode int
scond int
notscond int
}{arm.ABLS, arm.ABHI, 0x9, 0x8},
struct {
opcode int
notopcode int
scond int
notscond int
}{arm.ABGE, arm.ABLT, 0xA, 0xB},
struct {
opcode int
notopcode int
scond int
notscond int
}{arm.ABLT, arm.ABGE, 0xB, 0xA},
struct {
opcode int
notopcode int
scond int
notscond int
}{arm.ABGT, arm.ABLE, 0xC, 0xD},
struct {
opcode int
notopcode int
scond int
notscond int
}{arm.ABLE, arm.ABGT, 0xD, 0xC},
} }
type Joininfo struct { type Joininfo struct {
......
This diff is collapsed.
...@@ -25,14 +25,8 @@ var exper = []struct { ...@@ -25,14 +25,8 @@ var exper = []struct {
name string name string
val *int val *int
}{ }{
struct { {"fieldtrack", &Fieldtrack_enabled},
name string {"framepointer", &Framepointer_enabled},
val *int
}{"fieldtrack", &Fieldtrack_enabled},
struct {
name string
val *int
}{"framepointer", &Framepointer_enabled},
} }
func addexp(s string) { func addexp(s string) {
......
...@@ -47,58 +47,19 @@ var headers = []struct { ...@@ -47,58 +47,19 @@ var headers = []struct {
name string name string
val int val int
}{ }{
struct { {"darwin", Hdarwin},
name string {"dragonfly", Hdragonfly},
val int {"elf", Helf},
}{"darwin", Hdarwin}, {"freebsd", Hfreebsd},
struct { {"linux", Hlinux},
name string {"android", Hlinux}, // must be after "linux" entry or else headstr(Hlinux) == "android"
val int {"nacl", Hnacl},
}{"dragonfly", Hdragonfly}, {"netbsd", Hnetbsd},
struct { {"openbsd", Hopenbsd},
name string {"plan9", Hplan9},
val int {"solaris", Hsolaris},
}{"elf", Helf}, {"windows", Hwindows},
struct { {"windowsgui", Hwindows},
name string
val int
}{"freebsd", Hfreebsd},
struct {
name string
val int
}{"linux", Hlinux},
struct {
name string
val int
}{"android", Hlinux}, // must be after "linux" entry or else headstr(Hlinux) == "android"
struct {
name string
val int
}{"nacl", Hnacl},
struct {
name string
val int
}{"netbsd", Hnetbsd},
struct {
name string
val int
}{"openbsd", Hopenbsd},
struct {
name string
val int
}{"plan9", Hplan9},
struct {
name string
val int
}{"solaris", Hsolaris},
struct {
name string
val int
}{"windows", Hwindows},
struct {
name string
val int
}{"windowsgui", Hwindows},
} }
func headtype(name string) int { func headtype(name string) int {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment