LEFT | RIGHT |
(no file at all) | |
1 // Copyright 2012 The Go Authors. All rights reserved. | 1 // Copyright 2012 The Go Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style | 2 // Use of this source code is governed by a BSD-style |
3 // license that can be found in the LICENSE file. | 3 // license that can be found in the LICENSE file. |
4 | 4 |
5 // This file implements typechecking of builtin function calls. | 5 // This file implements typechecking of builtin function calls. |
6 | 6 |
7 package types | 7 package types |
8 | 8 |
9 import ( | 9 import ( |
10 "go/ast" | 10 "go/ast" |
(...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
448 return sizeof(ctxt, typ.Elt) * typ.Len | 448 return sizeof(ctxt, typ.Elt) * typ.Len |
449 case *Struct: | 449 case *Struct: |
450 var size int64 | 450 var size int64 |
451 for _, f := range typ.Fields { | 451 for _, f := range typ.Fields { |
452 size += sizeof(ctxt, f.Type) | 452 size += sizeof(ctxt, f.Type) |
453 } | 453 } |
454 return size | 454 return size |
455 } | 455 } |
456 return ctxt.PtrSize // good enough | 456 return ctxt.PtrSize // good enough |
457 } | 457 } |
LEFT | RIGHT |