Commit bcd6403c authored by Russ Cox's avatar Russ Cox

remove unnecessary 6g workaround

R=r
DELTA=51  (0 added, 0 deleted, 51 changed)
OCL=18399
CL=18402
parent 1ff61cef
...@@ -21,17 +21,17 @@ export type Value interface { ...@@ -21,17 +21,17 @@ export type Value interface {
// Common fields and functionality for all values // Common fields and functionality for all values
type CommonV struct { // BUG: want to call this Common but 6g does not hide the name type Common struct {
kind int; kind int;
typ Type; typ Type;
addr Addr; addr Addr;
} }
func (c *CommonV) Kind() int { func (c *Common) Kind() int {
return c.kind return c.kind
} }
func (c *CommonV) Type() Type { func (c *Common) Type() Type {
return c.typ return c.typ
} }
...@@ -68,11 +68,11 @@ export type MissingValue interface { ...@@ -68,11 +68,11 @@ export type MissingValue interface {
} }
type MissingValueStruct struct { type MissingValueStruct struct {
CommonV Common
} }
func MissingCreator(typ Type, addr Addr) Value { func MissingCreator(typ Type, addr Addr) Value {
return &MissingValueStruct{ CommonV{IntKind, typ, addr} } return &MissingValueStruct{ Common{IntKind, typ, addr} }
} }
// -- Int // -- Int
...@@ -85,11 +85,11 @@ export type IntValue interface { ...@@ -85,11 +85,11 @@ export type IntValue interface {
} }
type IntValueStruct struct { type IntValueStruct struct {
CommonV Common
} }
func IntCreator(typ Type, addr Addr) Value { func IntCreator(typ Type, addr Addr) Value {
return &IntValueStruct{ CommonV{IntKind, typ, addr} } return &IntValueStruct{ Common{IntKind, typ, addr} }
} }
func (v *IntValueStruct) Get() int { func (v *IntValueStruct) Get() int {
...@@ -110,11 +110,11 @@ export type Int8Value interface { ...@@ -110,11 +110,11 @@ export type Int8Value interface {
} }
type Int8ValueStruct struct { type Int8ValueStruct struct {
CommonV Common
} }
func Int8Creator(typ Type, addr Addr) Value { func Int8Creator(typ Type, addr Addr) Value {
return &Int8ValueStruct{ CommonV{Int8Kind, typ, addr} } return &Int8ValueStruct{ Common{Int8Kind, typ, addr} }
} }
func (v *Int8ValueStruct) Get() int8 { func (v *Int8ValueStruct) Get() int8 {
...@@ -135,11 +135,11 @@ export type Int16Value interface { ...@@ -135,11 +135,11 @@ export type Int16Value interface {
} }
type Int16ValueStruct struct { type Int16ValueStruct struct {
CommonV Common
} }
func Int16Creator(typ Type, addr Addr) Value { func Int16Creator(typ Type, addr Addr) Value {
return &Int16ValueStruct{ CommonV{Int16Kind, typ, addr} } return &Int16ValueStruct{ Common{Int16Kind, typ, addr} }
} }
func (v *Int16ValueStruct) Get() int16 { func (v *Int16ValueStruct) Get() int16 {
...@@ -160,11 +160,11 @@ export type Int32Value interface { ...@@ -160,11 +160,11 @@ export type Int32Value interface {
} }
type Int32ValueStruct struct { type Int32ValueStruct struct {
CommonV Common
} }
func Int32Creator(typ Type, addr Addr) Value { func Int32Creator(typ Type, addr Addr) Value {
return &Int32ValueStruct{ CommonV{Int32Kind, typ, addr} } return &Int32ValueStruct{ Common{Int32Kind, typ, addr} }
} }
func (v *Int32ValueStruct) Get() int32 { func (v *Int32ValueStruct) Get() int32 {
...@@ -185,11 +185,11 @@ export type Int64Value interface { ...@@ -185,11 +185,11 @@ export type Int64Value interface {
} }
type Int64ValueStruct struct { type Int64ValueStruct struct {
CommonV Common
} }
func Int64Creator(typ Type, addr Addr) Value { func Int64Creator(typ Type, addr Addr) Value {
return &Int64ValueStruct{ CommonV{Int64Kind, typ, addr} } return &Int64ValueStruct{ Common{Int64Kind, typ, addr} }
} }
func (v *Int64ValueStruct) Get() int64 { func (v *Int64ValueStruct) Get() int64 {
...@@ -210,11 +210,11 @@ export type UintValue interface { ...@@ -210,11 +210,11 @@ export type UintValue interface {
} }
type UintValueStruct struct { type UintValueStruct struct {
CommonV Common
} }
func UintCreator(typ Type, addr Addr) Value { func UintCreator(typ Type, addr Addr) Value {
return &UintValueStruct{ CommonV{UintKind, typ, addr} } return &UintValueStruct{ Common{UintKind, typ, addr} }
} }
func (v *UintValueStruct) Get() uint { func (v *UintValueStruct) Get() uint {
...@@ -235,11 +235,11 @@ export type Uint8Value interface { ...@@ -235,11 +235,11 @@ export type Uint8Value interface {
} }
type Uint8ValueStruct struct { type Uint8ValueStruct struct {
CommonV Common
} }
func Uint8Creator(typ Type, addr Addr) Value { func Uint8Creator(typ Type, addr Addr) Value {
return &Uint8ValueStruct{ CommonV{Uint8Kind, typ, addr} } return &Uint8ValueStruct{ Common{Uint8Kind, typ, addr} }
} }
func (v *Uint8ValueStruct) Get() uint8 { func (v *Uint8ValueStruct) Get() uint8 {
...@@ -260,11 +260,11 @@ export type Uint16Value interface { ...@@ -260,11 +260,11 @@ export type Uint16Value interface {
} }
type Uint16ValueStruct struct { type Uint16ValueStruct struct {
CommonV Common
} }
func Uint16Creator(typ Type, addr Addr) Value { func Uint16Creator(typ Type, addr Addr) Value {
return &Uint16ValueStruct{ CommonV{Uint16Kind, typ, addr} } return &Uint16ValueStruct{ Common{Uint16Kind, typ, addr} }
} }
func (v *Uint16ValueStruct) Get() uint16 { func (v *Uint16ValueStruct) Get() uint16 {
...@@ -285,11 +285,11 @@ export type Uint32Value interface { ...@@ -285,11 +285,11 @@ export type Uint32Value interface {
} }
type Uint32ValueStruct struct { type Uint32ValueStruct struct {
CommonV Common
} }
func Uint32Creator(typ Type, addr Addr) Value { func Uint32Creator(typ Type, addr Addr) Value {
return &Uint32ValueStruct{ CommonV{Uint32Kind, typ, addr} } return &Uint32ValueStruct{ Common{Uint32Kind, typ, addr} }
} }
func (v *Uint32ValueStruct) Get() uint32 { func (v *Uint32ValueStruct) Get() uint32 {
...@@ -310,11 +310,11 @@ export type Uint64Value interface { ...@@ -310,11 +310,11 @@ export type Uint64Value interface {
} }
type Uint64ValueStruct struct { type Uint64ValueStruct struct {
CommonV Common
} }
func Uint64Creator(typ Type, addr Addr) Value { func Uint64Creator(typ Type, addr Addr) Value {
return &Uint64ValueStruct{ CommonV{Uint64Kind, typ, addr} } return &Uint64ValueStruct{ Common{Uint64Kind, typ, addr} }
} }
func (v *Uint64ValueStruct) Get() uint64 { func (v *Uint64ValueStruct) Get() uint64 {
...@@ -335,11 +335,11 @@ export type FloatValue interface { ...@@ -335,11 +335,11 @@ export type FloatValue interface {
} }
type FloatValueStruct struct { type FloatValueStruct struct {
CommonV Common
} }
func FloatCreator(typ Type, addr Addr) Value { func FloatCreator(typ Type, addr Addr) Value {
return &FloatValueStruct{ CommonV{FloatKind, typ, addr} } return &FloatValueStruct{ Common{FloatKind, typ, addr} }
} }
func (v *FloatValueStruct) Get() float { func (v *FloatValueStruct) Get() float {
...@@ -360,11 +360,11 @@ export type Float32Value interface { ...@@ -360,11 +360,11 @@ export type Float32Value interface {
} }
type Float32ValueStruct struct { type Float32ValueStruct struct {
CommonV Common
} }
func Float32Creator(typ Type, addr Addr) Value { func Float32Creator(typ Type, addr Addr) Value {
return &Float32ValueStruct{ CommonV{Float32Kind, typ, addr} } return &Float32ValueStruct{ Common{Float32Kind, typ, addr} }
} }
func (v *Float32ValueStruct) Get() float32 { func (v *Float32ValueStruct) Get() float32 {
...@@ -385,11 +385,11 @@ export type Float64Value interface { ...@@ -385,11 +385,11 @@ export type Float64Value interface {
} }
type Float64ValueStruct struct { type Float64ValueStruct struct {
CommonV Common
} }
func Float64Creator(typ Type, addr Addr) Value { func Float64Creator(typ Type, addr Addr) Value {
return &Float64ValueStruct{ CommonV{Float64Kind, typ, addr} } return &Float64ValueStruct{ Common{Float64Kind, typ, addr} }
} }
func (v *Float64ValueStruct) Get() float64 { func (v *Float64ValueStruct) Get() float64 {
...@@ -410,11 +410,11 @@ export type Float80Value interface { ...@@ -410,11 +410,11 @@ export type Float80Value interface {
} }
type Float80ValueStruct struct { type Float80ValueStruct struct {
CommonV Common
} }
func Float80Creator(typ Type, addr Addr) Value { func Float80Creator(typ Type, addr Addr) Value {
return &Float80ValueStruct{ CommonV{Float80Kind, typ, addr} } return &Float80ValueStruct{ Common{Float80Kind, typ, addr} }
} }
/* /*
...@@ -439,11 +439,11 @@ export type StringValue interface { ...@@ -439,11 +439,11 @@ export type StringValue interface {
} }
type StringValueStruct struct { type StringValueStruct struct {
CommonV Common
} }
func StringCreator(typ Type, addr Addr) Value { func StringCreator(typ Type, addr Addr) Value {
return &StringValueStruct{ CommonV{StringKind, typ, addr} } return &StringValueStruct{ Common{StringKind, typ, addr} }
} }
func (v *StringValueStruct) Get() string { func (v *StringValueStruct) Get() string {
...@@ -464,11 +464,11 @@ export type BoolValue interface { ...@@ -464,11 +464,11 @@ export type BoolValue interface {
} }
type BoolValueStruct struct { type BoolValueStruct struct {
CommonV Common
} }
func BoolCreator(typ Type, addr Addr) Value { func BoolCreator(typ Type, addr Addr) Value {
return &BoolValueStruct{ CommonV{BoolKind, typ, addr} } return &BoolValueStruct{ Common{BoolKind, typ, addr} }
} }
func (v *BoolValueStruct) Get() bool { func (v *BoolValueStruct) Get() bool {
...@@ -489,7 +489,7 @@ export type PtrValue interface { ...@@ -489,7 +489,7 @@ export type PtrValue interface {
} }
type PtrValueStruct struct { type PtrValueStruct struct {
CommonV Common
} }
func (v *PtrValueStruct) Get() Addr { func (v *PtrValueStruct) Get() Addr {
...@@ -501,7 +501,7 @@ func (v *PtrValueStruct) Sub() Value { ...@@ -501,7 +501,7 @@ func (v *PtrValueStruct) Sub() Value {
} }
func PtrCreator(typ Type, addr Addr) Value { func PtrCreator(typ Type, addr Addr) Value {
return &PtrValueStruct{ CommonV{PtrKind, typ, addr} }; return &PtrValueStruct{ Common{PtrKind, typ, addr} };
} }
// -- Array // -- Array
...@@ -515,7 +515,7 @@ export type ArrayValue interface { ...@@ -515,7 +515,7 @@ export type ArrayValue interface {
} }
type OpenArrayValueStruct struct { type OpenArrayValueStruct struct {
CommonV; Common;
elemtype Type; elemtype Type;
elemsize uint64; elemsize uint64;
} }
...@@ -542,7 +542,7 @@ func (v *OpenArrayValueStruct) Elem(i uint64) Value { ...@@ -542,7 +542,7 @@ func (v *OpenArrayValueStruct) Elem(i uint64) Value {
} }
type FixedArrayValueStruct struct { type FixedArrayValueStruct struct {
CommonV; Common;
elemtype Type; elemtype Type;
elemsize uint64; elemsize uint64;
len uint64; len uint64;
...@@ -592,11 +592,11 @@ export type MapValue interface { ...@@ -592,11 +592,11 @@ export type MapValue interface {
} }
type MapValueStruct struct { type MapValueStruct struct {
CommonV Common
} }
func MapCreator(typ Type, addr Addr) Value { func MapCreator(typ Type, addr Addr) Value {
return &MapValueStruct{ CommonV{MapKind, typ, addr} } return &MapValueStruct{ Common{MapKind, typ, addr} }
} }
func (v *MapValueStruct) Len() int { func (v *MapValueStruct) Len() int {
...@@ -616,11 +616,11 @@ export type ChanValue interface { ...@@ -616,11 +616,11 @@ export type ChanValue interface {
} }
type ChanValueStruct struct { type ChanValueStruct struct {
CommonV Common
} }
func ChanCreator(typ Type, addr Addr) Value { func ChanCreator(typ Type, addr Addr) Value {
return &ChanValueStruct{ CommonV{ChanKind, typ, addr} } return &ChanValueStruct{ Common{ChanKind, typ, addr} }
} }
// -- Struct // -- Struct
...@@ -633,7 +633,7 @@ export type StructValue interface { ...@@ -633,7 +633,7 @@ export type StructValue interface {
} }
type StructValueStruct struct { type StructValueStruct struct {
CommonV; Common;
field *[]Value; field *[]Value;
} }
...@@ -648,7 +648,7 @@ func (v *StructValueStruct) Field(i int) Value { ...@@ -648,7 +648,7 @@ func (v *StructValueStruct) Field(i int) Value {
func StructCreator(typ Type, addr Addr) Value { func StructCreator(typ Type, addr Addr) Value {
t := typ.(StructType); t := typ.(StructType);
nfield := t.Len(); nfield := t.Len();
v := &StructValueStruct{ CommonV{StructKind, typ, addr}, new([]Value, nfield) }; v := &StructValueStruct{ Common{StructKind, typ, addr}, new([]Value, nfield) };
for i := 0; i < nfield; i++ { for i := 0; i < nfield; i++ {
name, ftype, str, offset := t.Field(i); name, ftype, str, offset := t.Field(i);
v.field[i] = NewValueAddr(ftype, addr + offset); v.field[i] = NewValueAddr(ftype, addr + offset);
...@@ -665,11 +665,11 @@ export type InterfaceValue interface { ...@@ -665,11 +665,11 @@ export type InterfaceValue interface {
} }
type InterfaceValueStruct struct { type InterfaceValueStruct struct {
CommonV Common
} }
func InterfaceCreator(typ Type, addr Addr) Value { func InterfaceCreator(typ Type, addr Addr) Value {
return &InterfaceValueStruct{ CommonV{InterfaceKind, typ, addr} } return &InterfaceValueStruct{ Common{InterfaceKind, typ, addr} }
} }
// -- Func // -- Func
...@@ -680,11 +680,11 @@ export type FuncValue interface { ...@@ -680,11 +680,11 @@ export type FuncValue interface {
} }
type FuncValueStruct struct { type FuncValueStruct struct {
CommonV Common
} }
func FuncCreator(typ Type, addr Addr) Value { func FuncCreator(typ Type, addr Addr) Value {
return &FuncValueStruct{ CommonV{FuncKind, typ, addr} } return &FuncValueStruct{ Common{FuncKind, typ, addr} }
} }
var creator *map[int] Creator var creator *map[int] Creator
......
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