1
0
mirror of https://github.com/golang/go synced 2024-10-05 02:31:21 -06:00
go/src/lib/reflect/gencast.sh
Russ Cox b65a930453 utf8: add InString routines for decoding in strings
reflect: add InterfaceValue.Get(), remove Empty
strconv: add Quote, CanBackquote
fmt:
	* %q go-quoted " string
	* %#q go-quoted ` string if possible, " string otherwise
	* %x hexadecimal string
	* anywhere a string is okay, *[]byte is okay
	* flags # 0 - + space
	* print value inside interface, not interface itself
	* tests

R=r
DELTA=756  (597 added, 121 deleted, 38 changed)
OCL=19888
CL=19916
2008-11-24 13:04:27 -08:00

43 lines
723 B
Bash
Executable File

#!/bin/bash
# Copyright 2009 The Go Authors. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
awk '
BEGIN {
print("// Conversion operators - really just casts")
print("// *** Created by gencast.sh - Do Not Edit ***\n")}
{
print("TEXT reflect·AddrToPtr" $0 "(SB),7,$-8")
print("\tMOVQ 8(SP), AX")
print("\tMOVQ AX, 16(SP)")
print("\tRET")
print("")
print("TEXT reflect·Ptr" $0 "ToAddr(SB),7,$-8")
print("\tMOVQ 8(SP), AX")
print("\tMOVQ AX, 16(SP)")
print("\tRET")
print("")
}
' > cast_$GOARCH.s << '!'
Addr
Int
Int8
Int16
Int32
Int64
Uint
Uint8
Uint16
Uint32
Uint64
Float
Float32
Float64
Float80
String
Bool
RuntimeArray
Interface
!