abi.Name; runtime: MakeAnyInt => MakeAnyIntptr; llgo/ssa: AllocU; builtin unsafe.String; MakeInterface; prog.PointerSize

This commit is contained in:
xushiwei
2024-05-20 08:46:39 +08:00
parent a6b8edde62
commit e61ebb4eb9
13 changed files with 342 additions and 63 deletions

Binary file not shown.

View File

@@ -34,7 +34,7 @@ var (
type Interface = iface
func MakeAnyInt(typ *Type, data uintptr) Interface {
func MakeAnyIntptr(typ *Type, data uintptr) Interface {
tab := &itab{inter: TyAny, _type: typ, hash: 0, fun: [1]uintptr{0}}
return Interface{
tab: tab, data: unsafe.Pointer(data),

View File

@@ -40,6 +40,7 @@ func EmptyString() String {
return String{nil, 0}
}
// TODO(xsw): unsafe.String
// NewString creates a new string.
func NewString(data unsafe.Pointer, len int) String {
return String{data, len}