aboutsummaryrefslogtreecommitdiffhomepage
path: root/compiler
diff options
context:
space:
mode:
authorDamian Gryski <[email protected]>2023-03-20 13:20:14 -0700
committerRon Evans <[email protected]>2023-09-10 13:05:18 +0200
commit0042bf62a5c40cd3005104c1b146a965fed3e605 (patch)
tree6a0da78bcd8f484ea1310d7212e64701c1b7b37f /compiler
parentf11731ff35efe573030896b499cfa8bd4d13e9dc (diff)
downloadtinygo-0042bf62a5c40cd3005104c1b146a965fed3e605.tar.gz
tinygo-0042bf62a5c40cd3005104c1b146a965fed3e605.zip
compiler,reflect: add support for [...]T -> []T in reflect
Diffstat (limited to 'compiler')
-rw-r--r--compiler/interface.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/compiler/interface.go b/compiler/interface.go
index 81234b0c9..116ad6677 100644
--- a/compiler/interface.go
+++ b/compiler/interface.go
@@ -218,6 +218,7 @@ func (c *compilerContext) getTypeCode(typ types.Type) llvm.Value {
types.NewVar(token.NoPos, nil, "ptrTo", types.Typ[types.UnsafePointer]),
types.NewVar(token.NoPos, nil, "elementType", types.Typ[types.UnsafePointer]),
types.NewVar(token.NoPos, nil, "length", types.Typ[types.Uintptr]),
+ types.NewVar(token.NoPos, nil, "sliceOf", types.Typ[types.UnsafePointer]),
)
case *types.Map:
typeFieldTypes = append(typeFieldTypes,
@@ -326,6 +327,7 @@ func (c *compilerContext) getTypeCode(typ types.Type) llvm.Value {
c.getTypeCode(types.NewPointer(typ)), // ptrTo
c.getTypeCode(typ.Elem()), // elementType
llvm.ConstInt(c.uintptrType, uint64(typ.Len()), false), // length
+ c.getTypeCode(types.NewSlice(typ.Elem())), // slicePtr
}
case *types.Map:
typeFields = []llvm.Value{