1
0
mirror of https://github.com/golang/go synced 2024-10-03 04:21:22 -06:00

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: Josh Bleecher Snyder <josharian@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Dave Cheney <dave@cheney.net>
This commit is contained in:
Matthew Dempsky 2015-04-10 15:25:10 -07:00
parent 985461fd9e
commit ce469fadd8
4 changed files with 153 additions and 403 deletions

View File

@ -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 {

View File

@ -223,382 +223,261 @@ const (
type DWAbbrev struct { type DWAbbrev struct {
tag uint8 tag uint8
children uint8 children uint8
attr [30]DWAttrForm attr []DWAttrForm
} }
var abbrevs = [DW_NABRV]struct { var abbrevs = [DW_NABRV]DWAbbrev{
tag uint8
children uint8
attr [30]DWAttrForm
}{
/* The mandatory DW_ABRV_NULL entry. */ /* The mandatory DW_ABRV_NULL entry. */
struct { {0, 0, []DWAttrForm{}},
tag uint8
children uint8
attr [30]DWAttrForm
}{0, 0, [30]DWAttrForm{}},
/* COMPUNIT */ /* COMPUNIT */
struct { {
tag uint8
children uint8
attr [30]DWAttrForm
}{
DW_TAG_compile_unit, DW_TAG_compile_unit,
DW_CHILDREN_yes, DW_CHILDREN_yes,
[30]DWAttrForm{ []DWAttrForm{
DWAttrForm{DW_AT_name, DW_FORM_string}, {DW_AT_name, DW_FORM_string},
DWAttrForm{DW_AT_language, DW_FORM_data1}, {DW_AT_language, DW_FORM_data1},
DWAttrForm{DW_AT_low_pc, DW_FORM_addr}, {DW_AT_low_pc, DW_FORM_addr},
DWAttrForm{DW_AT_high_pc, DW_FORM_addr}, {DW_AT_high_pc, DW_FORM_addr},
DWAttrForm{DW_AT_stmt_list, DW_FORM_data4}, {DW_AT_stmt_list, DW_FORM_data4},
DWAttrForm{0, 0},
}, },
}, },
/* FUNCTION */ /* FUNCTION */
struct { {
tag uint8
children uint8
attr [30]DWAttrForm
}{
DW_TAG_subprogram, DW_TAG_subprogram,
DW_CHILDREN_yes, DW_CHILDREN_yes,
[30]DWAttrForm{ []DWAttrForm{
DWAttrForm{DW_AT_name, DW_FORM_string}, {DW_AT_name, DW_FORM_string},
DWAttrForm{DW_AT_low_pc, DW_FORM_addr}, {DW_AT_low_pc, DW_FORM_addr},
DWAttrForm{DW_AT_high_pc, DW_FORM_addr}, {DW_AT_high_pc, DW_FORM_addr},
DWAttrForm{DW_AT_external, DW_FORM_flag}, {DW_AT_external, DW_FORM_flag},
DWAttrForm{0, 0},
}, },
}, },
/* VARIABLE */ /* VARIABLE */
struct { {
tag uint8
children uint8
attr [30]DWAttrForm
}{
DW_TAG_variable, DW_TAG_variable,
DW_CHILDREN_no, DW_CHILDREN_no,
[30]DWAttrForm{ []DWAttrForm{
DWAttrForm{DW_AT_name, DW_FORM_string}, {DW_AT_name, DW_FORM_string},
DWAttrForm{DW_AT_location, DW_FORM_block1}, {DW_AT_location, DW_FORM_block1},
DWAttrForm{DW_AT_type, DW_FORM_ref_addr}, {DW_AT_type, DW_FORM_ref_addr},
DWAttrForm{DW_AT_external, DW_FORM_flag}, {DW_AT_external, DW_FORM_flag},
DWAttrForm{0, 0},
}, },
}, },
/* AUTO */ /* AUTO */
struct { {
tag uint8
children uint8
attr [30]DWAttrForm
}{
DW_TAG_variable, DW_TAG_variable,
DW_CHILDREN_no, DW_CHILDREN_no,
[30]DWAttrForm{ []DWAttrForm{
DWAttrForm{DW_AT_name, DW_FORM_string}, {DW_AT_name, DW_FORM_string},
DWAttrForm{DW_AT_location, DW_FORM_block1}, {DW_AT_location, DW_FORM_block1},
DWAttrForm{DW_AT_type, DW_FORM_ref_addr}, {DW_AT_type, DW_FORM_ref_addr},
DWAttrForm{0, 0},
}, },
}, },
/* PARAM */ /* PARAM */
struct { {
tag uint8
children uint8
attr [30]DWAttrForm
}{
DW_TAG_formal_parameter, DW_TAG_formal_parameter,
DW_CHILDREN_no, DW_CHILDREN_no,
[30]DWAttrForm{ []DWAttrForm{
DWAttrForm{DW_AT_name, DW_FORM_string}, {DW_AT_name, DW_FORM_string},
DWAttrForm{DW_AT_location, DW_FORM_block1}, {DW_AT_location, DW_FORM_block1},
DWAttrForm{DW_AT_type, DW_FORM_ref_addr}, {DW_AT_type, DW_FORM_ref_addr},
DWAttrForm{0, 0},
}, },
}, },
/* STRUCTFIELD */ /* STRUCTFIELD */
struct { {
tag uint8
children uint8
attr [30]DWAttrForm
}{
DW_TAG_member, DW_TAG_member,
DW_CHILDREN_no, DW_CHILDREN_no,
[30]DWAttrForm{ []DWAttrForm{
DWAttrForm{DW_AT_name, DW_FORM_string}, {DW_AT_name, DW_FORM_string},
DWAttrForm{DW_AT_data_member_location, DW_FORM_block1}, {DW_AT_data_member_location, DW_FORM_block1},
DWAttrForm{DW_AT_type, DW_FORM_ref_addr}, {DW_AT_type, DW_FORM_ref_addr},
DWAttrForm{0, 0},
}, },
}, },
/* FUNCTYPEPARAM */ /* FUNCTYPEPARAM */
struct { {
tag uint8
children uint8
attr [30]DWAttrForm
}{
DW_TAG_formal_parameter, DW_TAG_formal_parameter,
DW_CHILDREN_no, DW_CHILDREN_no,
// No name! // No name!
[30]DWAttrForm{ []DWAttrForm{
DWAttrForm{DW_AT_type, DW_FORM_ref_addr}, {DW_AT_type, DW_FORM_ref_addr},
DWAttrForm{0, 0},
}, },
}, },
/* DOTDOTDOT */ /* DOTDOTDOT */
struct { {
tag uint8
children uint8
attr [30]DWAttrForm
}{
DW_TAG_unspecified_parameters, DW_TAG_unspecified_parameters,
DW_CHILDREN_no, DW_CHILDREN_no,
[30]DWAttrForm{DWAttrForm{0, 0}}, []DWAttrForm{},
}, },
/* ARRAYRANGE */ /* ARRAYRANGE */
struct { {
tag uint8
children uint8
attr [30]DWAttrForm
}{
DW_TAG_subrange_type, DW_TAG_subrange_type,
DW_CHILDREN_no, DW_CHILDREN_no,
// No name! // No name!
[30]DWAttrForm{ []DWAttrForm{
DWAttrForm{DW_AT_type, DW_FORM_ref_addr}, {DW_AT_type, DW_FORM_ref_addr},
DWAttrForm{DW_AT_count, DW_FORM_udata}, {DW_AT_count, DW_FORM_udata},
DWAttrForm{0, 0},
}, },
}, },
// Below here are the types considered public by ispubtype // Below here are the types considered public by ispubtype
/* NULLTYPE */ /* NULLTYPE */
struct { {
tag uint8
children uint8
attr [30]DWAttrForm
}{
DW_TAG_unspecified_type, DW_TAG_unspecified_type,
DW_CHILDREN_no, DW_CHILDREN_no,
[30]DWAttrForm{ []DWAttrForm{
DWAttrForm{DW_AT_name, DW_FORM_string}, {DW_AT_name, DW_FORM_string},
DWAttrForm{0, 0},
}, },
}, },
/* BASETYPE */ /* BASETYPE */
struct { {
tag uint8
children uint8
attr [30]DWAttrForm
}{
DW_TAG_base_type, DW_TAG_base_type,
DW_CHILDREN_no, DW_CHILDREN_no,
[30]DWAttrForm{ []DWAttrForm{
DWAttrForm{DW_AT_name, DW_FORM_string}, {DW_AT_name, DW_FORM_string},
DWAttrForm{DW_AT_encoding, DW_FORM_data1}, {DW_AT_encoding, DW_FORM_data1},
DWAttrForm{DW_AT_byte_size, DW_FORM_data1}, {DW_AT_byte_size, DW_FORM_data1},
DWAttrForm{DW_AT_go_kind, DW_FORM_data1}, {DW_AT_go_kind, DW_FORM_data1},
DWAttrForm{0, 0},
}, },
}, },
/* ARRAYTYPE */ /* ARRAYTYPE */
// child is subrange with upper bound // child is subrange with upper bound
struct { {
tag uint8
children uint8
attr [30]DWAttrForm
}{
DW_TAG_array_type, DW_TAG_array_type,
DW_CHILDREN_yes, DW_CHILDREN_yes,
[30]DWAttrForm{ []DWAttrForm{
DWAttrForm{DW_AT_name, DW_FORM_string}, {DW_AT_name, DW_FORM_string},
DWAttrForm{DW_AT_type, DW_FORM_ref_addr}, {DW_AT_type, DW_FORM_ref_addr},
DWAttrForm{DW_AT_byte_size, DW_FORM_udata}, {DW_AT_byte_size, DW_FORM_udata},
DWAttrForm{DW_AT_go_kind, DW_FORM_data1}, {DW_AT_go_kind, DW_FORM_data1},
DWAttrForm{0, 0},
}, },
}, },
/* CHANTYPE */ /* CHANTYPE */
struct { {
tag uint8
children uint8
attr [30]DWAttrForm
}{
DW_TAG_typedef, DW_TAG_typedef,
DW_CHILDREN_no, DW_CHILDREN_no,
[30]DWAttrForm{ []DWAttrForm{
DWAttrForm{DW_AT_name, DW_FORM_string}, {DW_AT_name, DW_FORM_string},
DWAttrForm{DW_AT_type, DW_FORM_ref_addr}, {DW_AT_type, DW_FORM_ref_addr},
DWAttrForm{DW_AT_go_kind, DW_FORM_data1}, {DW_AT_go_kind, DW_FORM_data1},
DWAttrForm{DW_AT_go_elem, DW_FORM_ref_addr}, {DW_AT_go_elem, DW_FORM_ref_addr},
DWAttrForm{0, 0},
}, },
}, },
/* FUNCTYPE */ /* FUNCTYPE */
struct { {
tag uint8
children uint8
attr [30]DWAttrForm
}{
DW_TAG_subroutine_type, DW_TAG_subroutine_type,
DW_CHILDREN_yes, DW_CHILDREN_yes,
[30]DWAttrForm{ []DWAttrForm{
DWAttrForm{DW_AT_name, DW_FORM_string}, {DW_AT_name, DW_FORM_string},
// {DW_AT_type, DW_FORM_ref_addr},
// {DW_AT_type, DW_FORM_ref_addr}, {DW_AT_go_kind, DW_FORM_data1},
DWAttrForm{DW_AT_go_kind, DW_FORM_data1},
DWAttrForm{0, 0},
}, },
}, },
/* IFACETYPE */ /* IFACETYPE */
struct { {
tag uint8
children uint8
attr [30]DWAttrForm
}{
DW_TAG_typedef, DW_TAG_typedef,
DW_CHILDREN_yes, DW_CHILDREN_yes,
[30]DWAttrForm{ []DWAttrForm{
DWAttrForm{DW_AT_name, DW_FORM_string}, {DW_AT_name, DW_FORM_string},
DWAttrForm{DW_AT_type, DW_FORM_ref_addr}, {DW_AT_type, DW_FORM_ref_addr},
DWAttrForm{DW_AT_go_kind, DW_FORM_data1}, {DW_AT_go_kind, DW_FORM_data1},
DWAttrForm{0, 0},
}, },
}, },
/* MAPTYPE */ /* MAPTYPE */
struct { {
tag uint8
children uint8
attr [30]DWAttrForm
}{
DW_TAG_typedef, DW_TAG_typedef,
DW_CHILDREN_no, DW_CHILDREN_no,
[30]DWAttrForm{ []DWAttrForm{
DWAttrForm{DW_AT_name, DW_FORM_string}, {DW_AT_name, DW_FORM_string},
DWAttrForm{DW_AT_type, DW_FORM_ref_addr}, {DW_AT_type, DW_FORM_ref_addr},
DWAttrForm{DW_AT_go_kind, DW_FORM_data1}, {DW_AT_go_kind, DW_FORM_data1},
DWAttrForm{DW_AT_go_key, DW_FORM_ref_addr}, {DW_AT_go_key, DW_FORM_ref_addr},
DWAttrForm{DW_AT_go_elem, DW_FORM_ref_addr}, {DW_AT_go_elem, DW_FORM_ref_addr},
DWAttrForm{0, 0},
}, },
}, },
/* PTRTYPE */ /* PTRTYPE */
struct { {
tag uint8
children uint8
attr [30]DWAttrForm
}{
DW_TAG_pointer_type, DW_TAG_pointer_type,
DW_CHILDREN_no, DW_CHILDREN_no,
[30]DWAttrForm{ []DWAttrForm{
DWAttrForm{DW_AT_name, DW_FORM_string}, {DW_AT_name, DW_FORM_string},
DWAttrForm{DW_AT_type, DW_FORM_ref_addr}, {DW_AT_type, DW_FORM_ref_addr},
DWAttrForm{DW_AT_go_kind, DW_FORM_data1}, {DW_AT_go_kind, DW_FORM_data1},
DWAttrForm{0, 0},
}, },
}, },
/* BARE_PTRTYPE */ /* BARE_PTRTYPE */
struct { {
tag uint8
children uint8
attr [30]DWAttrForm
}{
DW_TAG_pointer_type, DW_TAG_pointer_type,
DW_CHILDREN_no, DW_CHILDREN_no,
[30]DWAttrForm{ []DWAttrForm{
DWAttrForm{DW_AT_name, DW_FORM_string}, {DW_AT_name, DW_FORM_string},
DWAttrForm{0, 0},
}, },
}, },
/* SLICETYPE */ /* SLICETYPE */
struct { {
tag uint8
children uint8
attr [30]DWAttrForm
}{
DW_TAG_structure_type, DW_TAG_structure_type,
DW_CHILDREN_yes, DW_CHILDREN_yes,
[30]DWAttrForm{ []DWAttrForm{
DWAttrForm{DW_AT_name, DW_FORM_string}, {DW_AT_name, DW_FORM_string},
DWAttrForm{DW_AT_byte_size, DW_FORM_udata}, {DW_AT_byte_size, DW_FORM_udata},
DWAttrForm{DW_AT_go_kind, DW_FORM_data1}, {DW_AT_go_kind, DW_FORM_data1},
DWAttrForm{DW_AT_go_elem, DW_FORM_ref_addr}, {DW_AT_go_elem, DW_FORM_ref_addr},
DWAttrForm{0, 0},
}, },
}, },
/* STRINGTYPE */ /* STRINGTYPE */
struct { {
tag uint8
children uint8
attr [30]DWAttrForm
}{
DW_TAG_structure_type, DW_TAG_structure_type,
DW_CHILDREN_yes, DW_CHILDREN_yes,
[30]DWAttrForm{ []DWAttrForm{
DWAttrForm{DW_AT_name, DW_FORM_string}, {DW_AT_name, DW_FORM_string},
DWAttrForm{DW_AT_byte_size, DW_FORM_udata}, {DW_AT_byte_size, DW_FORM_udata},
DWAttrForm{DW_AT_go_kind, DW_FORM_data1}, {DW_AT_go_kind, DW_FORM_data1},
DWAttrForm{0, 0},
}, },
}, },
/* STRUCTTYPE */ /* STRUCTTYPE */
struct { {
tag uint8
children uint8
attr [30]DWAttrForm
}{
DW_TAG_structure_type, DW_TAG_structure_type,
DW_CHILDREN_yes, DW_CHILDREN_yes,
[30]DWAttrForm{ []DWAttrForm{
DWAttrForm{DW_AT_name, DW_FORM_string}, {DW_AT_name, DW_FORM_string},
DWAttrForm{DW_AT_byte_size, DW_FORM_udata}, {DW_AT_byte_size, DW_FORM_udata},
DWAttrForm{DW_AT_go_kind, DW_FORM_data1}, {DW_AT_go_kind, DW_FORM_data1},
DWAttrForm{0, 0},
}, },
}, },
/* TYPEDECL */ /* TYPEDECL */
struct { {
tag uint8
children uint8
attr [30]DWAttrForm
}{
DW_TAG_typedef, DW_TAG_typedef,
DW_CHILDREN_no, DW_CHILDREN_no,
[30]DWAttrForm{ []DWAttrForm{
DWAttrForm{DW_AT_name, DW_FORM_string}, {DW_AT_name, DW_FORM_string},
DWAttrForm{DW_AT_type, DW_FORM_ref_addr}, {DW_AT_type, DW_FORM_ref_addr},
DWAttrForm{0, 0},
}, },
}, },
} }
func writeabbrev() { func writeabbrev() {
var j int
var f *DWAttrForm
abbrevo = Cpos() abbrevo = Cpos()
for i := 1; i < DW_NABRV; i++ { for i := 1; i < DW_NABRV; i++ {
// See section 7.5.3 // See section 7.5.3
@ -606,14 +485,12 @@ func writeabbrev() {
uleb128put(int64(abbrevs[i].tag)) uleb128put(int64(abbrevs[i].tag))
Cput(abbrevs[i].children) Cput(abbrevs[i].children)
for j = 0; j < len(abbrevs[i].attr); j++ { for _, f := range abbrevs[i].attr {
f = &abbrevs[i].attr[j]
uleb128put(int64(f.attr)) uleb128put(int64(f.attr))
uleb128put(int64(f.form)) uleb128put(int64(f.form))
if f.attr == 0 {
break
}
} }
uleb128put(0)
uleb128put(0)
} }
Cput(0) Cput(0)
@ -975,18 +852,16 @@ func putattr(abbrev int, form int, cls int, value int64, data interface{}) {
// Note that we can (and do) add arbitrary attributes to a DIE, but // Note that we can (and do) add arbitrary attributes to a DIE, but
// only the ones actually listed in the Abbrev will be written out. // only the ones actually listed in the Abbrev will be written out.
func putattrs(abbrev int, attr *DWAttr) { func putattrs(abbrev int, attr *DWAttr) {
var ap *DWAttr Outer:
for _, f := range abbrevs[abbrev].attr {
for af := abbrevs[abbrev].attr[:]; af[0].attr != 0; af = af[1:] { for ap := attr; ap != nil; ap = ap.link {
for ap = attr; ap != nil; ap = ap.link { if ap.atr == f.attr {
if ap.atr == af[0].attr { putattr(abbrev, int(f.form), int(ap.cls), ap.value, ap.data)
putattr(abbrev, int(af[0].form), int(ap.cls), ap.value, ap.data) continue Outer
goto done
} }
} }
putattr(abbrev, int(af[0].form), 0, 0, nil) putattr(abbrev, int(f.form), 0, 0, nil)
done:
} }
} }

View File

@ -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) {

View File

@ -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 {