summaryrefslogtreecommitdiff
path: root/src/pkg/debug/dwarf/type.go
diff options
context:
space:
mode:
authorRobert Griesemer <gri@golang.org>2009-11-06 14:24:38 -0800
committerRobert Griesemer <gri@golang.org>2009-11-06 14:24:38 -0800
commit828334dd95ce8e4bf3662bd5c89d7c417f0741d0 (patch)
treefd7e0c9961bc3af2ddf105e9cc1943f2509ac584 /src/pkg/debug/dwarf/type.go
parenteb5cdfd67ff6d32df4c4c27840eaee027c5e3512 (diff)
downloadgolang-828334dd95ce8e4bf3662bd5c89d7c417f0741d0.tar.gz
- fine-tuning of one-line func heuristic (nodes.go)
- enabled for function declarations (not just function literals) - applied gofmt -w $GOROOT/src (look for instance at src/pkg/debug/elf/elf.go) R=r, rsc CC=go-dev http://go/go-review/1026006
Diffstat (limited to 'src/pkg/debug/dwarf/type.go')
-rw-r--r--src/pkg/debug/dwarf/type.go44
1 files changed, 11 insertions, 33 deletions
diff --git a/src/pkg/debug/dwarf/type.go b/src/pkg/debug/dwarf/type.go
index 91334bdf2..77d24f5d2 100644
--- a/src/pkg/debug/dwarf/type.go
+++ b/src/pkg/debug/dwarf/type.go
@@ -29,13 +29,9 @@ type CommonType struct {
Name string; // name that can be used to refer to type
}
-func (c *CommonType) Common() *CommonType {
- return c;
-}
+func (c *CommonType) Common() *CommonType { return c }
-func (c *CommonType) Size() int64 {
- return c.ByteSize;
-}
+func (c *CommonType) Size() int64 { return c.ByteSize }
// Basic types
@@ -46,9 +42,7 @@ type BasicType struct {
BitOffset int64;
}
-func (b *BasicType) Basic() *BasicType {
- return b;
-}
+func (b *BasicType) Basic() *BasicType { return b }
func (t *BasicType) String() string {
if t.Name != "" {
@@ -106,13 +100,9 @@ type QualType struct {
Type Type;
}
-func (t *QualType) String() string {
- return t.Qual + " " + t.Type.String();
-}
+func (t *QualType) String() string { return t.Qual + " " + t.Type.String() }
-func (t *QualType) Size() int64 {
- return t.Type.Size();
-}
+func (t *QualType) Size() int64 { return t.Type.Size() }
// An ArrayType represents a fixed size array type.
type ArrayType struct {
@@ -126,18 +116,14 @@ func (t *ArrayType) String() string {
return "[" + strconv.Itoa64(t.Count) + "]" + t.Type.String();
}
-func (t *ArrayType) Size() int64 {
- return t.Count * t.Type.Size();
-}
+func (t *ArrayType) Size() int64 { return t.Count * t.Type.Size() }
// A VoidType represents the C void type.
type VoidType struct {
CommonType;
}
-func (t *VoidType) String() string {
- return "void";
-}
+func (t *VoidType) String() string { return "void" }
// A PtrType represents a pointer type.
type PtrType struct {
@@ -145,9 +131,7 @@ type PtrType struct {
Type Type;
}
-func (t *PtrType) String() string {
- return "*" + t.Type.String();
-}
+func (t *PtrType) String() string { return "*" + t.Type.String() }
// A StructType represents a struct, union, or C++ class type.
type StructType struct {
@@ -258,9 +242,7 @@ type DotDotDotType struct {
CommonType;
}
-func (t *DotDotDotType) String() string {
- return "...";
-}
+func (t *DotDotDotType) String() string { return "..." }
// A TypedefType represents a named type.
type TypedefType struct {
@@ -268,13 +250,9 @@ type TypedefType struct {
Type Type;
}
-func (t *TypedefType) String() string {
- return t.Name;
-}
+func (t *TypedefType) String() string { return t.Name }
-func (t *TypedefType) Size() int64 {
- return t.Type.Size();
-}
+func (t *TypedefType) Size() int64 { return t.Type.Size() }
func (d *Data) Type(off Offset) (Type, os.Error) {
if t, ok := d.typeCache[off]; ok {