diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2015-12-28 12:58:10 +0100 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2015-12-28 12:58:10 +0100 |
| commit | 4eda9b07e5f25565333fdd8eed4e33850bd0f828 (patch) | |
| tree | 45d2ec43dbc07109ea665432e68bab98f0b2a15c /sys/decl.go | |
| parent | 9f9ae3fcc3efc74cbcb805b44575b5c140fa97ee (diff) | |
prog: don't serialize paddings
Paddings in serialized programs are unnecessary and confusing.
Instead restore them implicitly.
Also use [,,,,] for arrays.
Diffstat (limited to 'sys/decl.go')
| -rw-r--r-- | sys/decl.go | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/sys/decl.go b/sys/decl.go index 82f1871e1..af3202ae2 100644 --- a/sys/decl.go +++ b/sys/decl.go @@ -23,6 +23,13 @@ type Type interface { Align() uintptr } +func IsPad(t Type) bool { + if ct, ok := t.(ConstType); ok && ct.IsPad { + return true + } + return false +} + type TypeCommon struct { TypeName string IsOptional bool @@ -313,6 +320,7 @@ type ConstType struct { TypeCommon TypeSize uintptr Val uintptr + IsPad bool } func (t ConstType) Size() uintptr { @@ -654,5 +662,6 @@ func makePad(sz uintptr) Type { TypeCommon: TypeCommon{TypeName: "pad", IsOptional: false}, TypeSize: sz, Val: 0, + IsPad: true, } } |
