diff options
| author | Andrew Wilkins <axwalk@gmail.com> | 2016-03-15 05:36:43 +0000 |
|---|---|---|
| committer | Andrew Wilkins <axwalk@gmail.com> | 2016-03-15 05:36:43 +0000 |
| commit | 6436a4abd7a2f3a60b230453295dba199d8a59c3 (patch) | |
| tree | 125aef80fc2cf46c5d1758a8ece1fde14e7b13fd /llgo/third_party/gofrontend/libgo/go/encoding/binary/binary.go | |
| parent | 36761bf92427846ce40fdd849615732c852e44dd (diff) | |
| download | bcm5719-llvm-6436a4abd7a2f3a60b230453295dba199d8a59c3.tar.gz bcm5719-llvm-6436a4abd7a2f3a60b230453295dba199d8a59c3.zip | |
[llgo] Roll gofrontend forward
Switch gofrontend to using go.googlesource.com, and
update to 81eb6a3f425b2158c67ee32c0cc973a72ce9d6be.
There are various changes required to update to the
go 1.5 runtime:
typemap.go is changed to accommodate the change in representation for equal/hash algorithms, and the removal of the zero value/type.
CMakeLists.txt is updated to add the build tree to the package search path, so internal packages, which are not installed, are found.
various files changes due to removal of __go_new_nopointers; the same change as in D11863, but with NoUnwindAttribute added to the added runtime functions which are called with "callOnly".
minor cleanups in ssa.go while investigating issues with unwinding/panic handling.
Differential Revisision: http://reviews.llvm.org/D15188
llvm-svn: 263536
Diffstat (limited to 'llgo/third_party/gofrontend/libgo/go/encoding/binary/binary.go')
| -rw-r--r-- | llgo/third_party/gofrontend/libgo/go/encoding/binary/binary.go | 26 |
1 files changed, 5 insertions, 21 deletions
diff --git a/llgo/third_party/gofrontend/libgo/go/encoding/binary/binary.go b/llgo/third_party/gofrontend/libgo/go/encoding/binary/binary.go index 466bf97c973..2bbe07c02ff 100644 --- a/llgo/third_party/gofrontend/libgo/go/encoding/binary/binary.go +++ b/llgo/third_party/gofrontend/libgo/go/encoding/binary/binary.go @@ -13,7 +13,7 @@ // The varint functions encode and decode single integer values using // a variable-length encoding; smaller values require fewer bytes. // For a specification, see -// http://code.google.com/apis/protocolbuffers/docs/encoding.html. +// https://developers.google.com/protocol-buffers/docs/encoding. // // This package favors simplicity over efficiency. Clients that require // high-performance serialization, especially for large data structures, @@ -239,78 +239,62 @@ func Write(w io.Writer, order ByteOrder, data interface{}) error { } switch v := data.(type) { case *int8: - bs = b[:1] b[0] = byte(*v) case int8: - bs = b[:1] b[0] = byte(v) case []int8: for i, x := range v { bs[i] = byte(x) } case *uint8: - bs = b[:1] b[0] = *v case uint8: - bs = b[:1] b[0] = byte(v) case []uint8: bs = v case *int16: - bs = b[:2] order.PutUint16(bs, uint16(*v)) case int16: - bs = b[:2] order.PutUint16(bs, uint16(v)) case []int16: for i, x := range v { order.PutUint16(bs[2*i:], uint16(x)) } case *uint16: - bs = b[:2] order.PutUint16(bs, *v) case uint16: - bs = b[:2] order.PutUint16(bs, v) case []uint16: for i, x := range v { order.PutUint16(bs[2*i:], x) } case *int32: - bs = b[:4] order.PutUint32(bs, uint32(*v)) case int32: - bs = b[:4] order.PutUint32(bs, uint32(v)) case []int32: for i, x := range v { order.PutUint32(bs[4*i:], uint32(x)) } case *uint32: - bs = b[:4] order.PutUint32(bs, *v) case uint32: - bs = b[:4] order.PutUint32(bs, v) case []uint32: for i, x := range v { order.PutUint32(bs[4*i:], x) } case *int64: - bs = b[:8] order.PutUint64(bs, uint64(*v)) case int64: - bs = b[:8] order.PutUint64(bs, uint64(v)) case []int64: for i, x := range v { order.PutUint64(bs[8*i:], uint64(x)) } case *uint64: - bs = b[:8] order.PutUint64(bs, *v) case uint64: - bs = b[:8] order.PutUint64(bs, v) case []uint64: for i, x := range v { @@ -605,25 +589,25 @@ func (e *encoder) skip(v reflect.Value) { // It returns zero if the type cannot be implemented by the fast path in Read or Write. func intDataSize(data interface{}) int { switch data := data.(type) { - case int8, *int8, *uint8: + case int8, uint8, *int8, *uint8: return 1 case []int8: return len(data) case []uint8: return len(data) - case int16, *int16, *uint16: + case int16, uint16, *int16, *uint16: return 2 case []int16: return 2 * len(data) case []uint16: return 2 * len(data) - case int32, *int32, *uint32: + case int32, uint32, *int32, *uint32: return 4 case []int32: return 4 * len(data) case []uint32: return 4 * len(data) - case int64, *int64, *uint64: + case int64, uint64, *int64, *uint64: return 8 case []int64: return 8 * len(data) |

